MCPcopy Index your code
hub / github.com/chenfei-wu/TaskMatrix / extend_workflow

Method extend_workflow

LowCodeLLM/src/planningLLM.py:65–75  ·  view source on GitHub ↗
(self, task_prompt, current_workflow, step)

Source from the content-addressed store, hash-verified

63 return "OpenAI API error."
64
65 def extend_workflow(self, task_prompt, current_workflow, step):
66 messages = self.messages + [{'role': 'user', "content": PLANNING_LLM_PREFIX+'\nThe task is:\n'+task_prompt+PLANNING_LLM_SUFFIX}]
67 messages.append({'role': 'user', "content": EXTEND_PREFIX+
68 'The current SOP is:\n'+current_workflow+
69 '\nThe step needs to be extended is:\n'+step+
70 PLANNING_LLM_SUFFIX})
71 response, status = self.LLM.run(messages)
72 if status:
73 return self._txt2json(response)
74 else:
75 return "OpenAI API error."
76
77 def _txt2json(self, workflow_txt):
78 ''' convert the workflow in natural language to json format '''

Callers

nothing calls this directly

Calls 2

_txt2jsonMethod · 0.95
runMethod · 0.80

Tested by

no test coverage detected