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)
| 133 | |
| 134 | |
| 135 | def 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 | |
| 158 | def check_server_running(server_url: str) -> bool: |