Skip to content

Commit 28e5eb2

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 db32ea3 commit 28e5eb2

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
@@ -1847,8 +1847,9 @@ async def run_mcp_servers(
18471847

18481848
def to_ag_ui(
18491849
self,
1850-
*,
18511850
# Adapter parameters.
1851+
path: str = '/',
1852+
*,
18521853
tool_prefix: str = '',
18531854
logger: logging.Logger | None = None,
18541855
# Agent.iter parameters
@@ -1869,6 +1870,7 @@ def to_ag_ui(
18691870
18701871
Args:
18711872
logger: Optional logger to use for the adapter.
1873+
path: Path to expose the agent at, defaults to the root path.
18721874
tool_prefix: Optional prefix to add to tool names in the AG-UI.
18731875
18741876
output_type: Custom output type to use for this run, `output_type` may only be used if the agent has no
@@ -1894,6 +1896,7 @@ def to_ag_ui(
18941896

18951897
return agent_to_ag_ui(
18961898
agent=self,
1899+
path=path,
18971900
tool_prefix=tool_prefix,
18981901
logger=logger,
18991902
# Agent.iter parameters

0 commit comments

Comments
 (0)