Skip to content

Commit de43ffa

Browse files
committed
feat(ag-ui): expose agent path in adapter
Allow the agent path to be specified when using to_ag_ui.
1 parent 94bc907 commit de43ffa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pydantic_ai_slim/pydantic_ai/agent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1782,8 +1782,9 @@ async def run_mcp_servers(
17821782

17831783
def to_ag_ui(
17841784
self,
1785-
*,
17861785
# Adapter parameters.
1786+
path: str = '/',
1787+
*,
17871788
tool_prefix: str = '',
17881789
logger: logging.Logger | None = None,
17891790
# Agent.iter parameters
@@ -1804,6 +1805,7 @@ def to_ag_ui(
18041805
18051806
Args:
18061807
logger: Optional logger to use for the adapter.
1808+
path: Path to expose the agent at, defaults to the root path.
18071809
tool_prefix: Optional prefix to add to tool names in the AG-UI.
18081810
18091811
output_type: Custom output type to use for this run, `output_type` may only be used if the agent has no
@@ -1829,6 +1831,7 @@ def to_ag_ui(
18291831

18301832
return agent_to_ag_ui(
18311833
agent=self,
1834+
path=path,
18321835
tool_prefix=tool_prefix,
18331836
logger=logger,
18341837
# Agent.iter parameters

0 commit comments

Comments
 (0)