MCPcopy Create free account
hub / github.com/1Panel-dev/MaxKB / ToolWorkflowPostHandler

Class ToolWorkflowPostHandler

apps/application/flow/i_step_node.py:151–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149
150
151class ToolWorkflowPostHandler(WorkFlowPostHandler):
152 def __init__(self, chat_info, tool_id):
153 super().__init__(chat_info)
154 self.tool_id = tool_id
155
156 def handler(self, workflow):
157 state = get_tool_workflow_state(workflow)
158 record = ToolRecord(id=self.chat_info.tool_record_id, tool_id=self.tool_id,
159 workspace_id=self.chat_info.workspace_id,
160 source_type=self.chat_info.source_type,
161 source_id=self.chat_info.source_id,
162 state=state,
163 run_time=time.time() - workflow.context.get('start_time') if workflow.context.get(
164 'start_time') is not None else 0,
165 meta={
166 'input_field_list': workflow.get_input_field_list(),
167 'output_field_list': workflow.get_output_field_list(),
168 'input': workflow.get_input(),
169 'output': workflow.out_context,
170 'details': workflow.get_runtime_details(),
171 'answer_text_list': workflow.get_answer_text_list()
172 })
173 self.chat_info.set_record(record)
174 self.chat_info = None
175 self.tool_id = None
176
177
178def get_loop_workflow_node(node_list):

Callers 4

debugMethod · 0.90
executeMethod · 0.90
innerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected