/agents
Edit Agent
/datastores
/datastores/{id}/documents
/agents
/agents/{id}/query
/agents/{id}/evaluate
/agents/{id}/datasets/evaluate
/agents/{id}/datasets/tune
/agents/{id}/tune
/lmunit
/generate
/rerank
/agents
Edit Agent
Modify a given Agent
to utilize the provided configuration.
Fields not included in the request body will not be modified.
PUT
/
agents
/
{agent_id}
curl --request PUT \
--url https://api.contextual.ai/v1/agents/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"system_prompt": "<string>",
"no_retrieval_system_prompt": "<string>",
"filter_prompt": "<string>",
"suggested_queries": [
"<string>"
],
"agent_configs": {
"retrieval_config": {
"top_k_retrieved_chunks": 123,
"lexical_alpha": 123,
"semantic_alpha": 123
},
"filter_and_rerank_config": {
"top_k_reranked_chunks": 123,
"reranker_score_filter_threshold": 0,
"rerank_instructions": "<string>"
},
"generate_response_config": {
"max_new_tokens": 123,
"temperature": 123,
"top_p": 123,
"frequency_penalty": 123,
"seed": 123,
"calculate_groundedness": true,
"avoid_commentary": false
},
"global_config": {
"enable_rerank": true,
"enable_filter": true,
"enable_multi_turn": true,
"should_check_retrieval_need": true
},
"reformulation_config": {
"enable_query_expansion": true,
"query_expansion_prompt": "<string>",
"enable_query_decomposition": true,
"query_decomposition_prompt": "<string>"
}
},
"datastore_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"llm_model_id": "<string>"
}'
{}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
ID of the agent to edit
Body
application/json
Response
200
application/json
Successful Response
The response is of type object
.
Was this page helpful?
curl --request PUT \
--url https://api.contextual.ai/v1/agents/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"system_prompt": "<string>",
"no_retrieval_system_prompt": "<string>",
"filter_prompt": "<string>",
"suggested_queries": [
"<string>"
],
"agent_configs": {
"retrieval_config": {
"top_k_retrieved_chunks": 123,
"lexical_alpha": 123,
"semantic_alpha": 123
},
"filter_and_rerank_config": {
"top_k_reranked_chunks": 123,
"reranker_score_filter_threshold": 0,
"rerank_instructions": "<string>"
},
"generate_response_config": {
"max_new_tokens": 123,
"temperature": 123,
"top_p": 123,
"frequency_penalty": 123,
"seed": 123,
"calculate_groundedness": true,
"avoid_commentary": false
},
"global_config": {
"enable_rerank": true,
"enable_filter": true,
"enable_multi_turn": true,
"should_check_retrieval_need": true
},
"reformulation_config": {
"enable_query_expansion": true,
"query_expansion_prompt": "<string>",
"enable_query_decomposition": true,
"query_decomposition_prompt": "<string>"
}
},
"datastore_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"llm_model_id": "<string>"
}'
{}