Learn about the robust chat system and its various features for dynamic interaction with agents
Tool Integration
Multi-agent Sessions
agent
parameter in the chat settings.Response Formatting
Memory and Recall
Document References
recall_options
parameter configured with appropriate search parameters. For details on configuring recall_options
, see the Session: Recall Options documentation.recall
parameter)Message Object Structure
This object represents a message in the chat system, detailing the structure and types of data it can hold.
Parameter | Type | Description | Default |
---|---|---|---|
stream | bool | Indicates if the server should stream the response as it’s generated. | False |
stop | list[str] | Up to 4 sequences where the API will stop generating further tokens. | [] |
seed | int | If specified, the system will make a best effort to sample deterministically for that particular seed value. | None |
max_tokens | int | The maximum number of tokens to generate in the chat completion. | None |
logit_bias | dict[str, float] | Modify the likelihood of specified tokens appearing in the completion. | None |
response_format | str | Response format (set to json_object to restrict output to JSON). | None |
agent | UUID | Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) | None |
repetition_penalty | float | Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. | None |
length_penalty | float | Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. | None |
min_p | float | Minimum probability compared to leading token to be considered. | None |
frequency_penalty | float | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. | None |
presence_penalty | float | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. | None |
temperature | float | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. | None |
top_p | float | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. | 1.0 |
recall | bool | Whether to use the document (RAG) search or not | True |
save | bool | Whether this interaction should be stored in the session history or not | True |
remember | bool | DISABLED: Whether this interaction should form new memories or not (will be enabled in a future release) | False |
model | str | The model to use for the chat completion. | None |
metadata | dict[str, Any] | Custom metadata that can be passed to the system template for dynamic behavior. See System Templates for details. | None |
auto_run_tools | bool | Whether to automatically execute tools and send the results back to the model (requires tools on the agent) | False |
recall_tools | bool | Whether to include tool requests and responses when recalling messages from history | True |
application/json
MessageChatResponse
object containing the full generated message(s)id
: The unique identifier for the chat responsechoices
: An object of generated message completions containing:
role
: The role of the message (e.g. “assistant”, “user”, etc.)id
: Unique identifier for the messagecontent
: list of actual message contentcreated_at
: Timestamp when the message was createdname
: Optional name associated with the messagetool_call_id
: Optional ID referencing a tool calltool_calls
: Optional list of tool calls made during message generationcreated_at
: When this resource was created as UTC date-timedocs
: List of document references used for this request, intended for citation purposesjobs
: List of UUIDs for background jobs that may have been initiated as a result of this interactionusage
: Statistics on token usage for the completion requestauto_run_tools=true
:
auto_run_tools=false
(default):
recall_tools
parameter controls whether tool calls and their results are included when recalling conversation history:
recall_tools=true
(default): Tool interactions are preserved in the conversation historyrecall_tools=false
: Tool calls and results are excluded from recalled messages