MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / get_task_list

Function get_task_list

camel/utils/commons.py:135–155  ·  view source on GitHub ↗

r"""Parse the response of the Agent and return task list. Args: task_response (str): The string response of the Agent. Returns: List[str]: A list of the string tasks.

(task_response: str)

Source from the content-addressed store, hash-verified

133
134
135def get_task_list(task_response: str) -> List[str]:
136 r"""Parse the response of the Agent and return task list.
137
138 Args:
139 task_response (str): The string response of the Agent.
140
141 Returns:
142 List[str]: A list of the string tasks.
143 """
144
145 new_tasks_list = []
146 task_string_list = task_response.strip().split('\n')
147 # each task starts with #.
148 for task_string in task_string_list:
149 task_parts = task_string.strip().split(".", 1)
150 if len(task_parts) == 2:
151 task_id = ''.join(s for s in task_parts[0] if s.isnumeric())
152 task_name = re.sub(r'[^\w\s_]+', '', task_parts[1]).strip()
153 if task_name.strip() and task_id.isnumeric():
154 new_tasks_list.append(task_name)
155 return new_tasks_list
156
157
158def check_server_running(server_url: str) -> bool:

Callers 2

runMethod · 0.90
runMethod · 0.90

Calls 1

subMethod · 0.45

Tested by

no test coverage detected