| Name | Type | Description |
|---|---|---|
model* | str | The model deployment name. |
name* | str | The name of the agent. |
description | Optional[str] | Default: NoneOptional description. |
tools | Optional[Sequence[Union[AgentServiceBaseTool, BaseTool, Callable]]] | Default: None |
instructions | Optional[Prompt] | Default: None |
temperature | Optional[float] | Default: None |
top_p | Optional[float] | Default: None |
state_schema | Optional[StateSchemaType] | Default: None |
context_schema | Optional[Type[Any]] | Default: None |
checkpointer | Optional[Checkpointer] | Default: None |
store | Optional[BaseStore] | Default: None |
interrupt_before | Optional[list[str]] | Default: None |
interrupt_after | Optional[list[str]] | Default: None |
trace | bool | Default: False |
debug | bool | Default: False |
middleware | Sequence[AgentMiddleware] | Default: () |
Create a prompt-based agent using V2.
Tools for the agent.
System prompt instructions.
Sampling temperature.
Top-p sampling parameter.
State schema. Defaults to AgentServiceAgentState.
Context schema.
Checkpointer to use.
Store to use.
Nodes to interrupt before.
Nodes to interrupt after.
Whether to enable tracing.
Whether to enable debug mode.
A sequence of
:class:~langchain.agents.middleware.types.AgentMiddleware instances
to apply to the agent.
Middleware can intercept and modify agent behavior at various stages.
.. note:: The following middleware hooks are supported for the foundry agent service:
* ``before_agent`` / ``abefore_agent`` – runs **once** before
the agent graph execution starts.
* ``after_agent`` / ``aafter_agent`` – runs **once** after
the agent graph execution completes.
* ``wrap_tool_call`` / ``awrap_tool_call`` – intercepts
**client-side** tool execution (i.e. tools that are executed
locally by LangGraph, not inside the Azure AI agent service).
The ``before_model``, ``after_model``, and ``wrap_model_call``
hooks are **not** supported because the Azure AI agent service
encapsulates the model interaction; the node acts as a proxy
rather than directly invoking an LLM.