Skip to content

Commit b6bc088

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 3c6486f commit b6bc088

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pydantic_ai_slim/pydantic_ai/agent.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,7 @@ def to_ag_ui(
17701770
self,
17711771
*,
17721772
# Adapter parameters.
1773+
path: str = '/',
17731774
tool_prefix: str = '',
17741775
logger: logging.Logger | None = None,
17751776
# Agent.iter parameters
@@ -1790,6 +1791,7 @@ def to_ag_ui(
17901791
17911792
Args:
17921793
logger: Optional logger to use for the adapter.
1794+
path: Path to expose the agent at, defaults to the root path.
17931795
tool_prefix: Optional prefix to add to tool names in the AG-UI.
17941796
17951797
output_type: Custom output type to use for this run, `output_type` may only be used if the agent has no
@@ -1815,6 +1817,7 @@ def to_ag_ui(
18151817

18161818
return agent_to_ag_ui(
18171819
agent=self,
1820+
path=path,
18181821
tool_prefix=tool_prefix,
18191822
logger=logger,
18201823
# Agent.iter parameters

0 commit comments

Comments
 (0)