Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/strands/models/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ async def structured_output(
stop_reason, messages, _, _ = event["stop"]

if stop_reason != "tool_use":
raise ValueError(f"Model returned stop_reason: {stop_reason} instead of \"tool_use\".")
raise ValueError(f'Model returned stop_reason: {stop_reason} instead of "tool_use".')

content = messages["content"]
output_response: dict[str, Any] | None = None
Expand Down
2 changes: 1 addition & 1 deletion src/strands/models/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ async def structured_output(
stop_reason, messages, _, _ = event["stop"]

if stop_reason != "tool_use":
raise ValueError(f"Model returned stop_reason: {stop_reason} instead of \"tool_use\".")
raise ValueError(f'Model returned stop_reason: {stop_reason} instead of "tool_use".')

content = messages["content"]
output_response: dict[str, Any] | None = None
Expand Down
2 changes: 1 addition & 1 deletion src/strands/multiagent/a2a/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def execute(
task = new_task(context.message) # type: ignore
await event_queue.enqueue_event(task)

updater = TaskUpdater(event_queue, task.id, task.contextId)
updater = TaskUpdater(event_queue, task.id, task.context_id)

try:
await self._execute_streaming(context, updater)
Expand Down
3 changes: 2 additions & 1 deletion src/strands/session/file_session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class FileSessionManager(RepositorySessionManager, SessionRepository):
"""File-based session manager for local filesystem storage.

Creates the following filesystem structure for the session storage:
```bash
/<sessions_dir>/
└── session_<session_id>/
├── session.json # Session metadata
Expand All @@ -32,7 +33,7 @@ class FileSessionManager(RepositorySessionManager, SessionRepository):
└── messages/
├── message_<id1>.json
└── message_<id2>.json

```
"""

def __init__(self, session_id: str, storage_dir: Optional[str] = None, **kwargs: Any):
Expand Down
3 changes: 2 additions & 1 deletion src/strands/session/s3_session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class S3SessionManager(RepositorySessionManager, SessionRepository):
"""S3-based session manager for cloud storage.

Creates the following filesystem structure for the session storage:
```bash
/<sessions_dir>/
└── session_<session_id>/
├── session.json # Session metadata
Expand All @@ -33,7 +34,7 @@ class S3SessionManager(RepositorySessionManager, SessionRepository):
└── messages/
├── message_<id1>.json
└── message_<id2>.json

```
"""

def __init__(
Expand Down
16 changes: 8 additions & 8 deletions tests/strands/multiagent/a2a/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def mock_stream(user_input):
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

await executor.execute(mock_request_context, mock_event_queue)
Expand Down Expand Up @@ -65,7 +65,7 @@ async def mock_stream(user_input):
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

await executor.execute(mock_request_context, mock_event_queue)
Expand Down Expand Up @@ -95,7 +95,7 @@ async def mock_stream(user_input):
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

await executor.execute(mock_request_context, mock_event_queue)
Expand Down Expand Up @@ -125,7 +125,7 @@ async def mock_stream(user_input):
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

await executor.execute(mock_request_context, mock_event_queue)
Expand Down Expand Up @@ -156,7 +156,7 @@ async def mock_stream(user_input):
mock_request_context.current_task = None

with patch("strands.multiagent.a2a.executor.new_task") as mock_new_task:
mock_new_task.return_value = MagicMock(id="new-task-id", contextId="new-context-id")
mock_new_task.return_value = MagicMock(id="new-task-id", context_id="new-context-id")

await executor.execute(mock_request_context, mock_event_queue)

Expand All @@ -180,7 +180,7 @@ async def test_execute_streaming_mode_handles_agent_exception(
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

with pytest.raises(ServerError):
Expand Down Expand Up @@ -210,7 +210,7 @@ async def test_handle_agent_result_with_none_result(mock_strands_agent, mock_req
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

# Mock TaskUpdater
Expand All @@ -235,7 +235,7 @@ async def test_handle_agent_result_with_result_but_no_message(
# Mock the task creation
mock_task = MagicMock()
mock_task.id = "test-task-id"
mock_task.contextId = "test-context-id"
mock_task.context_id = "test-context-id"
mock_request_context.current_task = mock_task

# Mock TaskUpdater
Expand Down
4 changes: 2 additions & 2 deletions tests/strands/multiagent/a2a/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def test_public_agent_card(mock_strands_agent):
assert card.description == "A test agent for unit testing"
assert card.url == "http://0.0.0.0:9000/"
assert card.version == "0.0.1"
assert card.defaultInputModes == ["text"]
assert card.defaultOutputModes == ["text"]
assert card.default_input_modes == ["text"]
assert card.default_output_modes == ["text"]
assert card.skills == []
assert card.capabilities == a2a_agent.capabilities

Expand Down
Loading