update to new sdk - #9
Open
miwialex wants to merge 1 commit into
Open
Conversation
cal-smith
approved these changes
Aug 13, 2026
| validated = await ctx.step(validate_record, record) | ||
| ``` | ||
| This demonstrates **calling subtasks in a loop** for batch processing. | ||
| This demonstrates **stepping subtasks in a loop** for batch processing. |
There was a problem hiding this comment.
This right here is one of my complaints with step as a name
Suggested change
| This demonstrates **stepping subtasks in a loop** for batch processing. | |
| This demonstrates **calling subtasks in a loop** for batch processing. |
|
|
||
| # Process all files in parallel | ||
| # SUBTASK PATTERN: Call multiple subtasks concurrently using asyncio.gather() | ||
| # SUBTASK PATTERN: Step multiple subtasks concurrently using asyncio.gather() |
There was a problem hiding this comment.
Suggested change
| # SUBTASK PATTERN: Step multiple subtasks concurrently using asyncio.gather() | |
| # SUBTASK PATTERN: Call multiple subtasks concurrently using asyncio.gather() |
Comment on lines
+255
to
+256
| This demonstrates dynamic subtask execution via ctx.step, based on | ||
| agent decisions. |
There was a problem hiding this comment.
Suggested change
| This demonstrates dynamic subtask execution via ctx.step, based on | |
| agent decisions. | |
| This demonstrates dynamic subtask execution based on agent decisions. |
Comment on lines
+276
to
+277
| # SUBTASK CALL: ctx.step runs the tool task on its own compute. | ||
| # Each tool takes different arguments. |
There was a problem hiding this comment.
Suggested change
| # SUBTASK CALL: ctx.step runs the tool task on its own compute. | |
| # Each tool takes different arguments. | |
| # Different tools have different signatures |
| return result | ||
| async def execute_tool(ctx: TaskContext, tool_name: str, arguments: dict) -> dict: | ||
| # SUBTASK CALL: ctx.step runs the chosen tool on its own compute. | ||
| # Each tool takes different arguments. |
There was a problem hiding this comment.
Suggested change
| # Each tool takes different arguments. |
| 3. `await ctx.step(call_llm_with_tools, ...)` again with tool results to generate final response | ||
|
|
||
| This demonstrates **nested subtask calling**: `agent_turn` → `execute_tool` → `get_order_status` (3 levels deep!). | ||
| This demonstrates **nested subtask stepping**: `agent_turn` → `execute_tool` → `get_order_status` (3 levels deep!). |
There was a problem hiding this comment.
Suggested change
| This demonstrates **nested subtask stepping**: `agent_turn` → `execute_tool` → `get_order_status` (3 levels deep!). | |
| This demonstrates **nested subtask calling**: `agent_turn` → `execute_tool` → `get_order_status` (3 levels deep!). |
| conversation_history = turn_result["conversation_history"] | ||
| ``` | ||
| This demonstrates **calling subtasks in a loop** to maintain conversation state. | ||
| This demonstrates **stepping subtasks in a loop** to maintain conversation state. |
There was a problem hiding this comment.
Suggested change
| This demonstrates **stepping subtasks in a loop** to maintain conversation state. | |
| This demonstrates **calling subtasks in a loop** to maintain conversation state. |
| | Example | Use Case | Key Patterns | Extra Dependencies | | ||
| |---------|----------|--------------|-------------------| | ||
| | [**Hello World**](./hello-world/) | Learn workflow basics with simple number processing | Task definition, subtask calling with `await`, basic orchestration | None | | ||
| | [**Hello World**](./hello-world/) | Learn workflow basics with simple number processing | Task definition, subtask stepping with `ctx.step`, basic orchestration | None | |
There was a problem hiding this comment.
Suggested change
| | [**Hello World**](./hello-world/) | Learn workflow basics with simple number processing | Task definition, subtask stepping with `ctx.step`, basic orchestration | None | | |
| | [**Hello World**](./hello-world/) | Learn workflow basics with simple number processing | Task definition, subtask calling with `ctx.step`, basic orchestration | None | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
update to the new version of the SDK