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

Method get_workflow

LowCodeLLM/src/planningLLM.py:53–63  ·  view source on GitHub ↗

- input: task_prompt - output: workflow (json)

(self, task_prompt)

Source from the content-addressed store, hash-verified

51 self.messages = [{"role": "system", "content": "You are a helpful assistant."}]
52
53 def get_workflow(self, task_prompt):
54 '''
55 - input: task_prompt
56 - output: workflow (json)
57 '''
58 messages = self.messages + [{'role': 'user', "content": PLANNING_LLM_PREFIX+'\nThe task is:\n'+task_prompt+PLANNING_LLM_SUFFIX}]
59 response, status = self.LLM.run(messages)
60 if status:
61 return self._txt2json(response)
62 else:
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}]

Callers

nothing calls this directly

Calls 2

_txt2jsonMethod · 0.95
runMethod · 0.80

Tested by

no test coverage detected