Skip to content

Commit

Permalink
Fix the token count at the iteration node
Browse files Browse the repository at this point in the history
  • Loading branch information
s2terminal committed Dec 1, 2024
1 parent ef20481 commit 30b87b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/core/workflow/nodes/iteration/iteration_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ def _run(self) -> Generator[NodeEvent | InNodeEvent, None, None]:
run_result=NodeRunResult(
status=WorkflowNodeExecutionStatus.SUCCEEDED,
outputs={"output": jsonable_encoder(outputs)},
metadata={NodeRunMetadataKey.ITERATION_DURATION_MAP: iter_run_map},
metadata={
NodeRunMetadataKey.ITERATION_DURATION_MAP: iter_run_map,
NodeRunMetadataKey.TOTAL_TOKENS: graph_engine.graph_runtime_state.total_tokens,
},

)
)
except IterationNodeError as e:
Expand Down

0 comments on commit 30b87b7

Please sign in to comment.