airflow.providers.microsoft.azure.hooks.ai_agents¶
Attributes¶
Classes¶
Hook for Microsoft Foundry Hosted agents, backed by the |
|
Async hook for Microsoft Foundry Hosted agents. |
Module Contents¶
- class airflow.providers.microsoft.azure.hooks.ai_agents.AzureAIAgentsHook(azure_ai_agents_conn_id=default_conn_name, endpoint=None, api_version='v1', timeout=DEFAULT_REQUEST_TIMEOUT)[source]¶
Bases:
airflow.providers.common.compat.sdk.BaseHookHook for Microsoft Foundry Hosted agents, backed by the
azure-ai-projectsSDK.Wraps the Agents operations of
azure.ai.projects.AIProjectClient: https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/deploy-hosted-agent- Parameters:
azure_ai_agents_conn_id (str) – The Azure AI Agents connection id. Default is
azure_ai_agents_default.endpoint (str | None) – Optional Azure AI Foundry project endpoint. If not provided, the hook uses the connection host or the
endpointconnection extra. Default isNone.api_version (str) – Foundry Agent Service API version. Default is
v1.timeout (float | None) – Optional connection/read timeout for service requests, in seconds. Default is
60.0.
- classmethod get_connection_form_widgets()[source]¶
Return connection widgets to add to connection form.
- create_agent_version(agent_name, definition, *, metadata=None, description=None, blueprint_reference=None)[source]¶
Create a Hosted agent version, creating the Hosted agent itself on first use.
- Parameters:
agent_name (str) – Hosted agent name.
definition (dict[str, Any] | azure.ai.projects.models.AgentDefinition) – Hosted agent container definition.
metadata (dict[str, str] | None) – Optional metadata attached to the Hosted agent. Default is
None.description (str | None) – Optional human-readable Hosted agent description. Default is
None.blueprint_reference (azure.ai.projects.models.AgentBlueprintReference | None) – Optional managed identity blueprint reference. Default is
None.
- Returns:
Created Hosted agent version.
- Return type:
azure.ai.projects.models.AgentVersionDetails
- get_agent(agent_name)[source]¶
Get a Hosted agent.
- Parameters:
agent_name (str) – Hosted agent name.
- Returns:
Hosted agent details.
- Return type:
azure.ai.projects.models.AgentDetails
- delete_agent_version(agent_name, agent_version, *, force=False)[source]¶
Delete one Hosted agent version.
- is_agent_version_deleted(agent_name, agent_version)[source]¶
Return True if the Hosted agent version no longer exists or is deleted.
- invoke_agent_responses(agent_name, input_data, *, user_isolation_key=None)[source]¶
Invoke a Hosted agent through the OpenAI Responses protocol.
- Parameters:
- Returns:
JSON-compatible Responses protocol response.
- Return type:
- invoke_agent_invocations(agent_name, input_data, *, agent_session_id=None, user_isolation_key=None)[source]¶
Invoke a Hosted agent through the Invocations protocol.
The SDK does not expose the Invocations protocol yet, so the request is sent through the project client pipeline, which handles authentication and preview feature headers.
- Parameters:
- Returns:
JSON-compatible Invocations protocol payload; its shape is defined by the Hosted agent container.
- Return type:
pydantic.JsonValue
- class airflow.providers.microsoft.azure.hooks.ai_agents.AzureAIAgentsAsyncHook(azure_ai_agents_conn_id=AzureAIAgentsHook.default_conn_name, endpoint=None, api_version='v1', timeout=DEFAULT_REQUEST_TIMEOUT)[source]¶
Bases:
AzureAIAgentsHookAsync hook for Microsoft Foundry Hosted agents.
- Parameters:
azure_ai_agents_conn_id (str) – The Azure AI Agents connection id. Default is
azure_ai_agents_default.endpoint (str | None) – Optional Azure AI Foundry project endpoint override. Default is
None.api_version (str) – Foundry Agent Service API version. Default is
v1.timeout (float | None) – Optional connection/read timeout for service requests, in seconds. Default is
60.0.