Sessions
API for creating and modifying Sessions
List sessions
List sessions
List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of created_at
by default)
List of sessions (sorted created_at descending order) with limit+offset pagination
Create a new session
Create a new session
Create a session between an agent and a user
Session initialization options
(Optional) User ID of user to associate with this session
Agent ID of agent to associate with this session
A specific situation that sets the background for this session
Optional metadata
Render system and assistant message content as jinja templates
Session successfully created
IDs (if any) of jobs created as part of this request
Get a specific session by id
Get details of the session
Session id (UUID)
User ID of user associated with this session
Agent ID of agent associated with this session
A specific situation that sets the background for this session
(null at the beginning) - generated automatically after every interaction
Session created at (RFC-3339 format)
Session updated at (RFC-3339 format)
Optional metadata
Render system and assistant message content as jinja templates
Update a specific session by id
Update session parameters
Updated situation for this session
Optional metadata
IDs (if any) of jobs created as part of this request
Delete a specific session by id
Delete session
IDs (if any) of jobs created as part of this request
Chat
Interact with the session
A list of new input messages comprising the conversation so far.
(Advanced) List of tools that are provided in addition to agent's default set of tools. Functions of same name in agent set are overriden
Can be one of existing tools given to the agent earlier or the ones included in the request
(OpenAI-like) 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.
(Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated.
Modify the likelihood of specified tokens appearing in the completion.
Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
The maximum number of tokens to generate in the chat completion.
The total length of input tokens and generated tokens is limited by the model's context length.
(OpenAI-like) 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.
(Huggingface-like) 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.
An object specifying the format that the model must output.
Setting to { "type": "json_object" }
enables JSON mode, which guarantees the message the model generates is valid JSON.
Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length"
, which indicates the generation exceeded max_tokens
or the conversation exceeded the max context length.
This feature is in Beta.
If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed
and parameters should return the same result.
Determinism is not guaranteed, and you should refer to the system_fingerprint
response parameter to monitor changes in the backend.
Up to 4 sequences where the API will stop generating further tokens.
If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE]
message. Example Python code.
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.
0.75
Defaults to 1 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. We generally recommend altering this or temperature but not both.
1
Minimum probability compared to leading token to be considered
0.01
Generation preset name (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual)
Whether previous memories should be recalled or not
Whether this interaction should be recorded in history or not
Whether this interaction should form memories or not
A unique identifier for the chat completion.
The reason the model stopped generating tokens. This will be stop
if the model hit a natural stop point or a provided stop sequence, length
if the maximum number of tokens specified in the request was reached, content_filter
if content was omitted due to a flag from our content filters, tool_calls
if the model called a tool, or function_call
(deprecated) if the model called a function.
A list of chat completion messages produced as a response.
Usage statistics for the completion request.
IDs (if any) of jobs created as part of this request
Get suggestions made by the agent based on the session
Get autogenerated suggestions for session user and agent
Sorted (created_at descending)
Get a session's chat history
Get all messages in a session
Sorted (created_at ascending)
Last updated