Skip to main content

agents

Creates, updates, deletes, gets or lists an agents resource.

Overview

Nameagents
TypeResource
Idazure.ai_agents.agents

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier, which can be referenced in API endpoints. Required.
namestringThe name of the agent. Required.
created_atstring (date-time)The Unix timestamp, in seconds, representing when this object was created. Required.
descriptionstringThe description of the agent. Required.
instructionsstringThe system instructions for the agent to use. Required.
metadataobjectA set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. Required.
modelstringThe ID of the model to use. Required.
objectstringThe object type, which is always assistant. Required. Default value is "assistant".
response_formatobjectThe response format of the tool calls used by this agent. Is one of the following types: str, Union[str, "_models.AgentsResponseFormatMode"], AgentsResponseFormat, ResponseFormatJsonSchemaType
temperaturenumberWhat 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. Required.
tool_resourcesobjectA set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs. Required.
toolsarrayThe collection of tools enabled for the agent. Required.
top_pnumberAn 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. Required.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_agentselectassistant_id, endpointRetrieves an existing agent.
list_agentsselectendpointlimit, order, after, beforeGets a list of agents that were previously created.
create_agentinsertendpointCreates a new agent.
update_agentexecassistant_id, endpointModifies an existing agent.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
assistant_idstringThe ID of the agent to modify. Required.
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
afterstring
beforestringA cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Default value is None.
orderstringSort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Known values are: "asc" and "desc". Default value is None.

SELECT examples

Retrieves an existing agent.

SELECT
id,
name,
created_at,
description,
instructions,
metadata,
model,
object,
response_format,
temperature,
tool_resources,
tools,
top_p
FROM azure.ai_agents.agents
WHERE assistant_id = '{{ assistant_id }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;

INSERT examples

Creates a new agent.

INSERT INTO azure.ai_agents.agents (
endpoint
)
SELECT
'{{ endpoint }}'
RETURNING
id,
name,
created_at,
description,
instructions,
metadata,
model,
object,
response_format,
temperature,
tool_resources,
tools,
top_p
;

Lifecycle Methods

Modifies an existing agent.

EXEC azure.ai_agents.agents.update_agent 
@assistant_id='{{ assistant_id }}' --required,
@endpoint='{{ endpoint }}' --required
;