AgentsOperations Class
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
<xref:agents> attribute.
Constructor
AgentsOperations(*args, **kwargs)
Methods
| create_version |
Create a new agent version. |
| create_version_from_manifest |
Create a new agent version from a manifest. |
| delete |
Deletes an agent. |
| delete_version |
Deletes a specific version of an agent. |
| get |
Retrieves the agent. |
| get_version |
Retrieves a specific version of an agent. |
| list |
Returns the list of all agents. |
| list_versions |
Returns the list of versions of an agent. |
create_version
Create a new agent version.
create_version(agent_name: str, *, definition: _models.AgentDefinition, foundry_features: Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW] | Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW] | Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] | None = None, content_type: str = 'application/json', metadata: dict[str, str] | None = None, description: str | None = None, **kwargs: Any) -> _models.AgentVersionDetails
Parameters
| Name | Description |
|---|---|
|
agent_name
Required
|
The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
|
|
body
|
Is either a JSON type or a IO[bytes] type. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
definition
|
The agent definition. This can be a workflow, hosted agent, or a simple agent definition. Required. Default value: <object object at 0x00000217BE16B1C0>
|
|
foundry_features
|
str or
<xref:azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW> or
str or
<xref:azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW> or
str or
<xref:azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW>
A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. Default value: None
|
|
metadata
|
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. Default value is None. Default value: None
|
|
description
|
A human-readable description of the agent. Default value is None. Default value: None
|
Returns
| Type | Description |
|---|---|
|
AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
create_version_from_manifest
Create a new agent version from a manifest.
create_version_from_manifest(agent_name: str, *, manifest_id: str, parameter_values: dict[str, Any], content_type: str = 'application/json', metadata: dict[str, str] | None = None, description: str | None = None, **kwargs: Any) -> _models.AgentVersionDetails
Parameters
| Name | Description |
|---|---|
|
agent_name
Required
|
The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
|
|
body
|
Is either a JSON type or a IO[bytes] type. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
manifest_id
|
The manifest ID to import the agent version from. Required. Default value: <object object at 0x00000217BE16B1C0>
|
|
parameter_values
|
The inputs to the manifest that will result in a fully materialized Agent. Required. Default value: <object object at 0x00000217BE16B1C0>
|
|
metadata
|
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. Default value is None. Default value: None
|
|
description
|
A human-readable description of the agent. Default value is None. Default value: None
|
Returns
| Type | Description |
|---|---|
|
AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
delete
Deletes an agent.
delete(agent_name: str, **kwargs: Any) -> DeleteAgentResponse
Parameters
| Name | Description |
|---|---|
|
agent_name
Required
|
The name of the agent to delete. Required. |
Returns
| Type | Description |
|---|---|
|
DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
delete_version
Deletes a specific version of an agent.
delete_version(agent_name: str, agent_version: str, **kwargs: Any) -> DeleteAgentVersionResponse
Parameters
| Name | Description |
|---|---|
|
agent_name
Required
|
The name of the agent to delete. Required. |
|
agent_version
Required
|
The version of the agent to delete. Required. |
Returns
| Type | Description |
|---|---|
|
DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
get
Retrieves the agent.
get(agent_name: str, **kwargs: Any) -> AgentDetails
Parameters
| Name | Description |
|---|---|
|
agent_name
Required
|
The name of the agent to retrieve. Required. |
Returns
| Type | Description |
|---|---|
|
AgentDetails. The AgentDetails is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
get_version
Retrieves a specific version of an agent.
get_version(agent_name: str, agent_version: str, **kwargs: Any) -> AgentVersionDetails
Parameters
| Name | Description |
|---|---|
|
agent_name
Required
|
The name of the agent to retrieve. Required. |
|
agent_version
Required
|
The version of the agent to retrieve. Required. |
Returns
| Type | Description |
|---|---|
|
AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
list
Returns the list of all agents.
list(*, kind: str | AgentKind | None = None, limit: int | None = None, order: str | PageOrder | None = None, before: str | None = None, **kwargs: Any) -> ItemPaged[AgentDetails]
Keyword-Only Parameters
| Name | Description |
|---|---|
|
kind
|
Filter agents by kind. If not provided, all agents are returned. Known values are: "prompt", "hosted", "container_app", and "workflow". Default value is None. Default value: None
|
|
limit
|
A 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. Default value: None
|
|
order
|
Sort order by the Default value: None
|
|
before
|
A cursor for use in pagination. Default value: None
|
Returns
| Type | Description |
|---|---|
|
An iterator like instance of AgentDetails |
Exceptions
| Type | Description |
|---|---|
list_versions
Returns the list of versions of an agent.
list_versions(agent_name: str, *, limit: int | None = None, order: str | PageOrder | None = None, before: str | None = None, **kwargs: Any) -> ItemPaged[AgentVersionDetails]
Parameters
| Name | Description |
|---|---|
|
agent_name
Required
|
The name of the agent to retrieve versions for. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
limit
|
A 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. Default value: None
|
|
order
|
Sort order by the Default value: None
|
|
before
|
A cursor for use in pagination. Default value: None
|
Returns
| Type | Description |
|---|---|
|
An iterator like instance of AgentVersionDetails |
Exceptions
| Type | Description |
|---|---|