on_stream_chunk


Description:

public override void on_stream_chunk (string new_text, bool is_thinking, Chat response)

Override on_stream_chunk callback to process streaming content.

This method is connected as a signal handler to Agent.Base.stream_chunk signal in Agent.Base.register_tool_monitoring() when the tool is activated. It's disconnected in Agent.Base.unregister_tool() when the tool completes.

The signal is emitted by Agent.Base.handle_stream_chunk() which is called by Chat when streaming chunks arrive from the Ollama API.

Parameters:

new_text

The new text chunk

is_thinking

Whether this is a thinking chunk

response

The response object