Assistant streams its answer token by token
ai/client.py streams the completion and puts the chunks back together (Assembler), covering OpenAI's piecewise tool-call arguments, Ollama's whole calls, OpenRouter's comment lines, unnumbered calls and in-stream errors. The turn emits a delta event per piece and a message per round as before, and the chat grows the last answer as deltas arrive.
This commit is contained in:
@@ -115,8 +115,9 @@ export class AiService {
|
||||
* Chat
|
||||
* One turn, streamed as server-sent events.
|
||||
*
|
||||
* ``message``, ``tool_call`` and ``tool_result`` events as the model works,
|
||||
* ``error`` when something stops it, and ``done`` last either way.
|
||||
* ``delta`` as the model writes, ``message`` with a round's whole text,
|
||||
* ``tool_call`` and ``tool_result`` as it works, ``error`` when something
|
||||
* stops it, and ``done`` last either way.
|
||||
* @param data The data for the request.
|
||||
* @param data.requestBody
|
||||
* @returns unknown Successful Response
|
||||
|
||||
Reference in New Issue
Block a user