public chat<MESSAGE extends Map<String, String>>(messages as IList<MESSAGE>, maxNewTokens as Long = 128l) as String
Generates a textual assistant response from a text-only Qwen conversation. Thinking is disabled by the explicit template prefix; previous messages are supplied by the caller, not retained implicitly. Control-token spellings in user content are ordinary text, not new roles. Uses deterministic argmax.
| Parameter | Description |
|---|---|
messages | Ordered maps with role/content; final message must be user. |
maxNewTokens | Response bound, fitting maxContext with the prompt. |
Generated assistant text only, without EOS or role delimiters.
response = provider.chat([{"role": "user", "content": "What is the capital of France?"}])