Skip to content

Commit 73995f5

Browse files
authored
Update doc based on AF #1557 (#737)
1 parent 981ef08 commit 73995f5

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

agent-framework/migration-guide/from-autogen/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -974,9 +974,9 @@ async def join_any(msg: str, ctx: WorkflowContext[Never, str]) -> None:
974974

975975
@executor(id="join_all")
976976
async def join_all(msg: str, ctx: WorkflowContext[str, str]) -> None:
977-
state = await ctx.get_state() or {"items": []}
977+
state = await ctx.get_executor_state() or {"items": []}
978978
state["items"].append(msg)
979-
await ctx.set_state(state)
979+
await ctx.set_executor_state(state)
980980
if len(state["items"]) >= 2:
981981
await ctx.yield_output(" | ".join(state["items"])) # ALL join
982982

@@ -1404,7 +1404,7 @@ AutoGen's `Team` abstraction does not provide built-in checkpointing capabilitie
14041404

14051405
Agent Framework provides comprehensive checkpointing through `FileCheckpointStorage` and the `with_checkpointing()` method on `WorkflowBuilder`. Checkpoints capture:
14061406

1407-
- **Executor state**: Local state for each executor using `ctx.set_state()`
1407+
- **Executor state**: Local state for each executor using `ctx.set_executor_state()`
14081408
- **Shared state**: Cross-executor state using `ctx.set_shared_state()`
14091409
- **Message queues**: Pending messages between executors
14101410
- **Workflow position**: Current execution progress and next steps
@@ -1424,9 +1424,9 @@ class ProcessingExecutor(Executor):
14241424
print(f"Processing: '{data}' -> '{result}'")
14251425

14261426
# Persist executor-local state
1427-
prev_state = await ctx.get_state() or {}
1427+
prev_state = await ctx.get_executor_state() or {}
14281428
count = prev_state.get("count", 0) + 1
1429-
await ctx.set_state({
1429+
await ctx.set_executor_state({
14301430
"count": count,
14311431
"last_input": data,
14321432
"last_output": result

agent-framework/tutorials/workflows/checkpointing-and-resuming.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ class UpperCaseExecutor(Executor):
435435
result = text.upper()
436436

437437
# Persist executor-local state for checkpoints
438-
prev = await ctx.get_state() or {}
438+
prev = await ctx.get_executor_state() or {}
439439
count = int(prev.get("count", 0)) + 1
440-
await ctx.set_state({
440+
await ctx.set_executor_state({
441441
"count": count,
442442
"last_input": text,
443443
"last_output": result,

0 commit comments

Comments
 (0)