Skip to main content

Blocking Response

Use invoke() for blocking responses:

Streaming Response

Use stream() for real-time responses:

Event Streaming

For full visibility into tool calls and execution, use events=True to stream events instead of text:

Using with invoke()

You can also use events with invoke():

With Attachments

Pass file paths via context parameter:

Accessing History

Get messages as ChatMessage objects:

Session State

Check and manage session state: