| Name | Type | Description |
|---|---|---|
client* | AIProjectClient | The AIProjectClient instance. |
name* | str | The name of the agent in Azure AI Foundry. The node will fetch the requested version from the service during initialization. |
version | str | Default: 'latest'The version of the agent to use. Defaults to |
uses_container_template | bool | Default: False |
extra_headers | Optional[Dict[str, str]] | Default: None |
tags | Optional[Sequence[str]] | Default: None |
trace | bool | Default: True |
A LangGraph node for an existing Azure AI Foundry agent (V2 Responses API).
This node wraps a prompt-based agent that has already been created in Azure AI Foundry. It handles building requests and processing responses using the V2 Responses/Conversations API.
Use :meth:~langchain_azure_ai.agents.v2.AgentServiceFactory.create_prompt_agent_node
to create an agent and obtain a node in a single step, or instantiate this
class directly to reference an existing agent by name.
Example:
from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential
from langchain_azure_ai.agents.prebuilt import ResponsesAgentNode
client = AIProjectClient(
endpoint="https://resource.services.ai.azure.com/api/projects/demo-project",
credential=DefaultAzureCredential(),
)
coder = ResponsesAgentNode(
client=client,
name="code-interpreter-agent",
version="latest",
)Set to True when the agent definition
uses the {{container_id}} structured-input template for the
code interpreter. This is computed automatically by
:meth:~langchain_azure_ai.agents.v2.AgentServiceFactory.create_prompt_agent_node
when a :class:~azure.ai.projects.models.CodeInterpreterTool
without a fixed container is present in the tool list.
Optional HTTP headers to include in every
responses.create() call. Typically collected from
:attr:~langchain_azure_ai.agents._v2.prebuilt.tools.AgentServiceBaseTool.extra_headers
on any
:class:~langchain_azure_ai.agents._v2.prebuilt.tools.AgentServiceBaseTool
instances passed to the factory.
Optional tags for the runnable.
Whether to enable tracing.