Skip to content

Commit

Permalink
fix(io): update tuples are ignored by pregel io (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
dqbd authored Jan 15, 2025
1 parent 1cba1f2 commit d650ea7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libs/langgraph/src/pregel/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,15 @@ export function* mapCommand(
"Expected cmd.update to be a dict mapping channel names to update values"
);
}
for (const [k, v] of Object.entries(cmd.update)) {
yield [NULL_TASK_ID, k, v];

if (Array.isArray(cmd.update)) {
for (const [k, v] of cmd.update) {
yield [NULL_TASK_ID, k, v];
}
} else {
for (const [k, v] of Object.entries(cmd.update)) {
yield [NULL_TASK_ID, k, v];
}
}
}
}
Expand Down

0 comments on commit d650ea7

Please sign in to comment.