mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-22 17:26:54 +08:00
fix: iteration total tokens calculate error (#15813)
Co-authored-by: 刘江波 <jiangbo721@163.com>
This commit is contained in:
@@ -873,11 +873,12 @@ class GraphEngine:
|
||||
def create_copy(self):
|
||||
"""
|
||||
create a graph engine copy
|
||||
:return: with a new variable pool instance of graph engine
|
||||
:return: graph engine with a new variable pool and initialized total tokens
|
||||
"""
|
||||
new_instance = copy(self)
|
||||
new_instance.graph_runtime_state = copy(self.graph_runtime_state)
|
||||
new_instance.graph_runtime_state.variable_pool = deepcopy(self.graph_runtime_state.variable_pool)
|
||||
new_instance.graph_runtime_state.total_tokens = 0
|
||||
return new_instance
|
||||
|
||||
def _handle_continue_on_error(
|
||||
|
||||
Reference in New Issue
Block a user