Create Assistant
This method allows you to create a new agent. The agent requires an LLM to be used for generating completions, so you need to make sure the corresponding Model Endpoint has been deployed in the same namespace as this PAIS instance. You can use the List Models method to view all available LLMs.
An agent can be configured to use tool calls to enhance the context that is
sent to the LLM. In the cases when the configured LLM is not trained for reliable
tool calling or has no tools support at all, you can force automatic execution of
all configured tools by setting x-pais-force-static-tool-execution to true in
the metadata field. When static tool execution is enabled, all tools are called
before the LLM processes the request, with results automatically included in the
context. This mode only supports PAIS knowledge base search tools and simple
retrieval augmentation workflows. Using LLMs with full tool support allows the AI
to choose the specific search parameters to use for the knowledge retrieval, and it
thus greatly enhances search results and agent responses.
Show optional properties
{
"session_max_length": 0,
"session_summarization_strategy": "string",
"model": "string"
}
{
"name": "string",
"description": "string",
"instructions": "string",
"session_max_ttl": 0,
"completion_role": "string",
"tools": [
{
"link_type": "string",
"tool_id": "string"
}
],
"index_id": "string",
"index_top_n": 0,
"index_similarity_cutoff": "number",
"index_reference_format": "string",
"index_reference_delimiter": "string",
"session_max_length": 0,
"session_summarization_strategy": "string",
"metadata": {
"metadata": "string"
},
"model": "string",
"chat_system_instruction_mode": "string"
}
Name of the agent.
Description of the agent.
System instructions used by the agent.
Agent sessions that have not been written to within this many seconds are subject to deletion.
Response role for completions created by the agent. DEPRECATION WARNING: This property is deprecated and is subject to removal from agent requests and responses in the future.
A list of tools to be used by the agent.
Data Indexing and Retrieval index to be used by the agent. DEPRECATION WARNING: Direct linking to an index is deprecated and is subject to removal in the future. Use tools instead.
Top N chunks the agent should request from Data Indexing and Retrieval when fetching context from the index. DEPRECATION WARNING: Direct use of this property is deprecated and is subject to removal from agent requests and responses in the future. Use tools instead.
Chunk similarity the agent should request from Data Indexing and Retrieval when fetching context from the index. DEPRECATION WARNING: Direct use of this property is deprecated and is subject to removal from agent requests and responses in the future. Use tools instead.
Format in which index text references are returned by the agent.
Delimiter string to separate the agent completions response from the index references.
Sessions that exceed this length (in characters) will get summarized before new data is added. This value must be small enough to fit into the context window of the LLM used by this assistant (including any additional prompts sent to the LLM).
Strategy for summarizing an agent session once it exceeds the configured maximum session length.
Set of up to 16 key-value pairs attached to this agent. To delete a key from the agent metadata, set its value to null.
ID of the model to be used by the agent for generating completions.
Agent setting that decides how system instructions are sent to the LLM when generating completions. For LLMs supporting "system messages", this is the most robust choice, but not all LLMs support this type of instructions.
Successful Response
{
"name": "string",
"description": "string",
"instructions": "string",
"session_max_ttl": 0,
"completion_role": "string",
"tools": [
{
"link_type": "string",
"tool_id": "string"
}
],
"index_id": "string",
"index_top_n": 0,
"index_similarity_cutoff": "number",
"index_reference_format": "string",
"index_reference_delimiter": "string",
"session_max_length": 0,
"session_summarization_strategy": "string",
"metadata": {
"metadata": "string"
},
"id": "string",
"object": "string",
"created_at": 0,
"model": "string",
"status": "string",
"status_errors": [
"string"
],
"chat_system_instruction_mode": "string"
}
Name of the agent.
Description of the agent.
System instructions used by the agent.
Agent sessions that have not been written to within this many seconds are subject to deletion.
Response role for completions created by the agent. DEPRECATION WARNING: This property is deprecated and is subject to removal from agent requests and responses in the future.
A list of tools to be used by the agent.
Data Indexing and Retrieval index to be used by the agent. DEPRECATION WARNING: Direct linking to an index is deprecated and is subject to removal in the future. Use tools instead.
Top N chunks the agent should request from Data Indexing and Retrieval when fetching context from the index. DEPRECATION WARNING: Direct use of this property is deprecated and is subject to removal from agent requests and responses in the future. Use tools instead.
Chunk similarity the agent should request from Data Indexing and Retrieval when fetching context from the index. DEPRECATION WARNING: Direct use of this property is deprecated and is subject to removal from agent requests and responses in the future. Use tools instead.
Format in which index text references are returned by the agent.
Delimiter string to separate the agent completions response from the index references.
Sessions that exceed this length (in characters) will get summarized before new data is added. This value must be small enough to fit into the context window of the LLM used by this assistant (including any additional prompts sent to the LLM).
Strategy for summarizing an agent session once it exceeds the configured maximum session length.
Set of up to 16 key-value pairs attached to this agent. To delete a key from the agent metadata, set its value to null.
ID of the agent.
Object type, which is always agent.
Unix timestamp (in seconds) when the agent was created.
ID of the model to be used by the agent for generating completions.
Availability status of an agent.
Details of the agent error status, if the agent is not available.
Agent setting that decides how system instructions are sent to the LLM when generating completions. For LLMs supporting "system messages", this is the most robust choice, but not all LLMs support this type of instructions.
Endpoint with requested model does not exist.
The agent could not be linked to a tool that is not approved.
Validation Error
{
"detail": [
{
"loc": [
{}
],
"msg": "string",
"type": "string"
}
]
}
detail
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"session_max_length":"integer","session_summarization_strategy":"string","model":"string"}' https://{api_host}/api/v1/compatibility/openai/v1/assistants