Declarative chat agent node for Azure AI Foundry agents.
A tool that interacts with Azure AI Foundry Agent Service.
Use this class to wrap tools from Azure AI Foundry for use with DeclarativeChatAgentNode.
Example:
from langchain_azure_ai.agents.prebuilt.tools import AgentServiceBaseTool
from azure.ai.agents.models import CodeInterpreterTool
code_interpreter_tool = AgentServiceBaseTool(tool=CodeInterpreterTool())
If your tool requires further configuration, you may need to use the Azure AI Foundry SDK directly to create and configure the tool.
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],
)