Skip to main content

Chat Sessions

app.chat(message) stores the returned session_id and resends it on the next call. Multi-turn works with no bookkeeping from you.

app.chat("My name is Alex.")
print(app.chat("What is my name?").response) # knows it's Alex

ChatResponse​

Field
responseThe reply.
session_idCurrent session, or None before the first message.
retrieved_contextsData-source chunks used, if any.
structured_outputPresent when the agent has a response_schema.
selected_agent, handoff_pathSquad routing detail.
raw_payloadUnmodified API response.

Reset​

app.reset_session() # next message starts fresh

Helpers​

app.session().ask("Summarize the handbook.") # returns a ChatResponse
app.chat() # interactive terminal chat; "exit" to quit

Session state lives on the App instance — a new App starts clean.

Next​

Data Sources & RAG · Error Handling