AI Assistants API, REST: Assistant.Update
Update an existing assistant.
HTTP request
PATCH https://rest-assistant.api.cloud.yandex.net/assistants/v1/assistants/{assistantId}
Path parameters
Request message for updating an existing assistant.
Field |
Description |
assistantId |
string Required field. ID of the assistant to update. |
Body parameters
{
"updateMask": "object",
"name": "string",
"description": "string",
"expirationConfig": {
"expirationPolicy": "string",
"ttlDays": "string"
},
"labels": "object",
"modelUri": "string",
"instruction": "string",
"promptTruncationOptions": {
"maxPromptTokens": "string"
},
"completionOptions": {
"maxTokens": "string",
"temperature": "number"
},
"tools": [
{
// Includes only one of the fields `searchIndex`
"searchIndex": {
"searchIndexIds": [
"string"
],
"maxNumResults": "string"
}
// end of the list of possible fields
}
]
}
Request message for updating an existing assistant.
Field |
Description |
updateMask |
object (field-mask) Required field. A comma-separated names off ALL fields to be updated. If |
name |
string New name for the assistant. |
description |
string New description for the assistant. |
expirationConfig |
New expiration configuration for the assistant. |
labels |
object (map<string, string>) New set of labels for the assistant. |
modelUri |
string The new ID of the model to be used for completion generation. |
instruction |
string New instructions or guidelines for the assistant to follow. |
promptTruncationOptions |
New configuration for truncating the prompt. |
completionOptions |
New configuration for completion generation. |
tools[] |
New list of tools the assistant can use. |
ExpirationConfig
Field |
Description |
expirationPolicy |
enum (ExpirationPolicy)
|
ttlDays |
string (int64) |
PromptTruncationOptions
Defines the options for truncating thread messages within a prompt.
Field |
Description |
maxPromptTokens |
string (int64) The maximum number of tokens allowed in the prompt. |
CompletionOptions
Defines the options for completion generation.
Field |
Description |
maxTokens |
string (int64) The limit on the number of tokens used for single completion generation. |
temperature |
number (double) Affects creativity and randomness of responses. Should be a double number between 0 (inclusive) and 1 (inclusive). |
Tool
Represents a general tool that can be one of several types.
Field |
Description |
searchIndex |
SearchIndexTool tool that performs search across specified indexes. Includes only one of the fields |
SearchIndexTool
Configures a tool that enables Retrieval-Augmented Generation (RAG) by allowing the assistant to search across a specified search index.
Field |
Description |
searchIndexIds[] |
string A list of search index IDs that this tool will query. Currently, only a single index ID is supported. |
maxNumResults |
string (int64) The maximum number of results to return from the search. |
Response
HTTP Code: 200 - OK
{
"id": "string",
"folderId": "string",
"name": "string",
"description": "string",
"createdBy": "string",
"createdAt": "string",
"updatedBy": "string",
"updatedAt": "string",
"expirationConfig": {
"expirationPolicy": "string",
"ttlDays": "string"
},
"expiresAt": "string",
"labels": "object",
"modelUri": "string",
"instruction": "string",
"promptTruncationOptions": {
"maxPromptTokens": "string"
},
"completionOptions": {
"maxTokens": "string",
"temperature": "number"
},
"tools": [
{
// Includes only one of the fields `searchIndex`
"searchIndex": {
"searchIndexIds": [
"string"
],
"maxNumResults": "string"
}
// end of the list of possible fields
}
]
}
Assistant represents an AI assistant configuration with various settings and metadata.
Field |
Description |
id |
string Unique identifier of the assistant. |
folderId |
string ID of the folder that the assistant belongs to. |
name |
string Name of the assistant. |
description |
string Description of the assistant. |
createdBy |
string Identifier of the subject who created this assistant. |
createdAt |
string (date-time) Timestamp representing when the assistant was created. String in RFC3339 To work with values in this field, use the APIs described in the |
updatedBy |
string Identifier of the subject who last updated this assistant. |
updatedAt |
string (date-time) Timestamp representing the last time this assistant was updated. String in RFC3339 To work with values in this field, use the APIs described in the |
expirationConfig |
Configuration for the expiration of the assistant, defining when and how the assistant will expire. |
expiresAt |
string (date-time) Timestamp representing when the assistant will expire. String in RFC3339 To work with values in this field, use the APIs described in the |
labels |
object (map<string, string>) Set of key-value pairs that can be used to organize and categorize the assistant. |
modelUri |
string The ID of the model to be used for completion generation. |
instruction |
string Instructions or guidelines that the assistant should follow when generating responses or performing tasks. |
promptTruncationOptions |
Configuration options for truncating the prompt when the token count exceeds a specified limit. |
completionOptions |
Configuration options for completion generation. |
tools[] |
List of tools that the assistant can use to perform additional tasks. |
ExpirationConfig
Field |
Description |
expirationPolicy |
enum (ExpirationPolicy)
|
ttlDays |
string (int64) |
PromptTruncationOptions
Defines the options for truncating thread messages within a prompt.
Field |
Description |
maxPromptTokens |
string (int64) The maximum number of tokens allowed in the prompt. |
CompletionOptions
Defines the options for completion generation.
Field |
Description |
maxTokens |
string (int64) The limit on the number of tokens used for single completion generation. |
temperature |
number (double) Affects creativity and randomness of responses. Should be a double number between 0 (inclusive) and 1 (inclusive). |
Tool
Represents a general tool that can be one of several types.
Field |
Description |
searchIndex |
SearchIndexTool tool that performs search across specified indexes. Includes only one of the fields |
SearchIndexTool
Configures a tool that enables Retrieval-Augmented Generation (RAG) by allowing the assistant to search across a specified search index.
Field |
Description |
searchIndexIds[] |
string A list of search index IDs that this tool will query. Currently, only a single index ID is supported. |
maxNumResults |
string (int64) The maximum number of results to return from the search. |