Chat
The chat tool lets an agent hold a conversation with a knowledge base. Answers are generated from the content of the KBase you name, and the conversation history is kept on the server so that follow-up questions understand what has already been said.
Chat
Sends a message to a knowledge base and returns the assistant's reply. Pass a
sessionId to keep the conversation going across several calls.
Parameters
| Name | Type | Description |
|---|---|---|
indexId | string | The Id of the KBase to chat with. |
message | string | The user's message. |
sessionId | string (optional) | An identifier that ties this message to an existing conversation. If omitted, a fresh conversation is started. |
Returns
The assistant's response as text.
Conversation history
History is stored per user, per knowledge base and per session, and expires after
24 hours without use. To continue a conversation, send the same
sessionId with each message; to start again from scratch, send a new one (or
none at all). Because history is held on the server, an agent does not need to resend
earlier turns.
Notes
The indexId and message are both required; a call missing either
fails. If the underlying model cannot answer, the tool reports that an error occurred while
processing the chat request.