Skip to content

Commit b6e0849

Browse files
committed
fix: address pr comments
1 parent b930c09 commit b6e0849

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ format-fix = [
108108
]
109109
lint-check = [
110110
"ruff check",
111+
# excluding due to A2A and OTEL http exporter dependency conflict
111112
"mypy -p src --exclude src/strands/multiagent"
112113
]
113114
lint-fix = [
@@ -154,9 +155,11 @@ python = ["3.13", "3.12", "3.11", "3.10"]
154155

155156
[tool.hatch.envs.hatch-test.scripts]
156157
run = [
158+
# excluding due to A2A and OTEL http exporter dependency conflict
157159
"pytest{env:HATCH_TEST_ARGS:} {args} --ignore=tests/multiagent/a2a"
158160
]
159161
run-cov = [
162+
# excluding due to A2A and OTEL http exporter dependency conflict
160163
"pytest{env:HATCH_TEST_ARGS:} --cov --cov-config=pyproject.toml {args} --ignore=tests/multiagent/a2a"
161164
]
162165

@@ -192,6 +195,7 @@ prepare = [
192195
"hatch test --all"
193196
]
194197
test-a2a = [
198+
# required to run manually due to A2A and OTEL http exporter dependency conflict
195199
"hatch -e a2a run run {args}"
196200
]
197201

src/strands/agent/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ def __init__(
217217
load_tools_from_directory: bool = True,
218218
trace_attributes: Optional[Mapping[str, AttributeValue]] = None,
219219
*,
220-
name: str | None = None,
221-
description: str | None = None,
220+
name: Optional[str] = None,
221+
description: Optional[str] = None,
222222
):
223223
"""Initialize the Agent with the specified configuration.
224224

src/strands/multiagent/a2a/agent.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from ...agent.agent import Agent as SAAgent
1919
from .executor import StrandsA2AExecutor
2020

21-
log = logging.getLogger(__name__)
21+
logger = logging.getLogger(__name__)
2222

2323

2424
class 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

Comments
 (0)