Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/strands/multiagent/a2a/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,20 @@ def agent_skills(self, skills: list[AgentSkill]) -> None:
"""
self._agent_skills = skills

def to_starlette_app(self) -> Starlette:
def to_starlette_app(self, **kwargs: Any) -> Starlette:
"""Create a Starlette application for serving this agent via HTTP.

Automatically handles path-based mounting if a mount path was derived
from the http_url parameter.

**kwargs: Additional keyword arguments to pass to the Starlette constructor.

Returns:
Starlette: A Starlette application configured to serve this agent.
"""
a2a_app = A2AStarletteApplication(agent_card=self.public_agent_card, http_handler=self.request_handler).build()
a2a_app = A2AStarletteApplication(agent_card=self.public_agent_card, http_handler=self.request_handler).build(
**kwargs
)

if self.mount_path:
# Create parent app and mount the A2A app at the specified path
Expand All @@ -196,16 +200,21 @@ def to_starlette_app(self) -> Starlette:

return a2a_app

def to_fastapi_app(self) -> FastAPI:
def to_fastapi_app(self, **kwargs: Any) -> FastAPI:
"""Create a FastAPI application for serving this agent via HTTP.

Automatically handles path-based mounting if a mount path was derived
from the http_url parameter.

Args:
**kwargs: Additional keyword arguments to pass to the FastAPI constructor.

Returns:
FastAPI: A FastAPI application configured to serve this agent.
"""
a2a_app = A2AFastAPIApplication(agent_card=self.public_agent_card, http_handler=self.request_handler).build()
a2a_app = A2AFastAPIApplication(agent_card=self.public_agent_card, http_handler=self.request_handler).build(
**kwargs
)

if self.mount_path:
# Create parent app and mount the A2A app at the specified path
Expand Down