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