MCPcopy
hub / github.com/1Panel-dev/MaxKB / pop

Method pop

apps/application/flow/loop_workflow_manage.py:60–82  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 return self.node_chunk_list.__contains__(node_chunk)
59
60 def pop(self):
61 if self.current_node_chunk is None:
62 try:
63 current_node_chunk = self.node_chunk_list.pop(0)
64 self.current_node_chunk = current_node_chunk
65 except IndexError as e:
66 pass
67 if self.current_node_chunk is not None:
68 try:
69 chunk = self.current_node_chunk.chunk_list.pop(0)
70 return chunk
71 except IndexError as e:
72 if self.current_node_chunk.is_end():
73 self.current_node_chunk = None
74 if self.work_flow.answer_is_not_empty():
75 chunk = self.work_flow.base_to_response.to_stream_chunk_response(
76 self.work_flow.params['chat_id'],
77 self.work_flow.params['chat_record_id'],
78 '\n\n', False, 0, 0)
79 self.work_flow.append_answer('\n\n')
80 return chunk
81 return self.pop()
82 return None
83
84
85class LoopWorkflowManage(WorkflowManage):

Callers

nothing calls this directly

Calls 4

is_endMethod · 0.80
answer_is_not_emptyMethod · 0.80
append_answerMethod · 0.45

Tested by

no test coverage detected