1818from ...agent .agent import Agent as SAAgent
1919from .executor import StrandsA2AExecutor
2020
21- log = logging .getLogger (__name__ )
21+ logger = logging .getLogger (__name__ )
2222
2323
2424class A2AAgent :
@@ -29,7 +29,7 @@ def __init__(
2929 agent : SAAgent ,
3030 * ,
3131 # AgentCard
32- host : str = "0.0.0" ,
32+ host : str = "0.0.0.0 " ,
3333 port : int = 9000 ,
3434 version : str = "0.0.1" ,
3535 ):
@@ -39,7 +39,7 @@ def __init__(
3939 agent: The Strands Agent to wrap with A2A compatibility.
4040 name: The name of the agent, used in the AgentCard.
4141 description: A description of the agent's capabilities, used in the AgentCard.
42- host: The hostname or IP address to bind the A2A server to. Defaults to "localhost ".
42+ host: The hostname or IP address to bind the A2A server to. Defaults to "0.0.0.0 ".
4343 port: The port to bind the A2A server to. Defaults to 9000.
4444 version: The version of the agent. Defaults to "0.0.1".
4545 """
@@ -56,6 +56,7 @@ def __init__(
5656 agent_executor = StrandsA2AExecutor (self .strands_agent ),
5757 task_store = InMemoryTaskStore (),
5858 )
59+ logger .info ("Strands' integration with A2A is experimental. Be aware of frequent breaking changes." )
5960
6061 @property
6162 def public_agent_card (self ) -> AgentCard :
@@ -135,14 +136,14 @@ def serve(self, app_type: Literal["fastapi", "starlette"] = "starlette", **kwarg
135136 **kwargs: Additional keyword arguments to pass to uvicorn.run.
136137 """
137138 try :
138- log .info ("Starting Strands A2A server..." )
139+ logger .info ("Starting Strands A2A server..." )
139140 if app_type == "fastapi" :
140141 uvicorn .run (self .to_fastapi_app (), host = self .host , port = self .port , ** kwargs )
141142 else :
142143 uvicorn .run (self .to_starlette_app (), host = self .host , port = self .port , ** kwargs )
143144 except KeyboardInterrupt :
144- log .warning ("Strands A2A server shutdown requested (KeyboardInterrupt)." )
145+ logger .warning ("Strands A2A server shutdown requested (KeyboardInterrupt)." )
145146 except Exception :
146- log .exception ("Strands A2A server encountered exception." )
147+ logger .exception ("Strands A2A server encountered exception." )
147148 finally :
148- log .info ("Strands A2A server has shutdown." )
149+ logger .info ("Strands A2A server has shutdown." )
0 commit comments