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",
)