| Name | Type | Description |
|---|---|---|
client* | AgentsClient | The AgentsClient instance to use. |
agent* | Agent | An existing agent retrieved from Azure AI Foundry.
Use
:meth: |
name* | str | The display name for this LangGraph node. |
polling_interval | int | Default: 1The interval (in seconds) to poll for updates on the agent's status. Defaults to 1 second. |
tags | Optional[Sequence[str]] | Default: None |
trace | bool | Default: True |
A LangGraph node that represents a prompt-based agent in Azure AI Foundry.
You can use this node to create complex graphs that involve interactions with an Azure AI Foundry agent.
You can also use langchain_azure_ai.agents.AgentServiceFactory to create
instances of this node.
Example:
from azure.identity import DefaultAzureCredential
from langchain_azure_ai.agents import AgentServiceFactory
factory = AgentServiceFactory(
project_endpoint=(
"https://resource.services.ai.azure.com/api/projects/demo-project",
),
credential=DefaultAzureCredential()
)
coder = factory.create_prompt_agent_node(
name="code-interpreter-agent",
model="gpt-4.1",
instructions="You are a helpful assistant that can run Python code.",
tools=[func1, func2],
)Optional tags to associate with the agent.
Whether to enable tracing for the node. Defaults to True.