Skip to content

Commit bed1b68

Browse files
authored
fix: Allow none structured output context in tool executors (#1128)
1 parent db671ba commit bed1b68

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/strands/tools/executors/_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def _execute(
283283
cycle_trace: Trace,
284284
cycle_span: Any,
285285
invocation_state: dict[str, Any],
286-
structured_output_context: "StructuredOutputContext",
286+
structured_output_context: "StructuredOutputContext | None" = None,
287287
) -> AsyncGenerator[TypedEvent, None]:
288288
"""Execute the given tools according to this executor's strategy.
289289

src/strands/tools/executors/concurrent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def _execute(
2727
cycle_trace: Trace,
2828
cycle_span: Any,
2929
invocation_state: dict[str, Any],
30-
structured_output_context: "StructuredOutputContext",
30+
structured_output_context: "StructuredOutputContext | None" = None,
3131
) -> AsyncGenerator[TypedEvent, None]:
3232
"""Execute tools concurrently.
3333
@@ -88,7 +88,7 @@ async def _task(
8888
task_queue: asyncio.Queue,
8989
task_event: asyncio.Event,
9090
stop_event: object,
91-
structured_output_context: "StructuredOutputContext",
91+
structured_output_context: "StructuredOutputContext | None",
9292
) -> None:
9393
"""Execute a single tool and put results in the task queue.
9494

src/strands/tools/executors/sequential.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async def _execute(
2626
cycle_trace: Trace,
2727
cycle_span: Any,
2828
invocation_state: dict[str, Any],
29-
structured_output_context: "StructuredOutputContext",
29+
structured_output_context: "StructuredOutputContext | None" = None,
3030
) -> AsyncGenerator[TypedEvent, None]:
3131
"""Execute tools sequentially.
3232

0 commit comments

Comments
 (0)