š« CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
feat: `Task` in camel (#699)
maoquanaf9cf7a0eca9
diff --git a/camel/tasks/__init__.py b/camel/tasks/__init__.pynew file mode 100644index 000000000..4b8a03e07--- /dev/null+++ b/camel/tasks/__init__.py@@ -0,0 +1,22 @@+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========+# Licensed under the Apache License, Version 2.0 (the āLicenseā);+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an āAS ISā BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========+from .task import Task, TaskManager+from .task_prompt import TASK_DECOMPOSE_PROMPT, TASK_EVOLVE_PROMPT++__all__ = [+ "TASK_DECOMPOSE_PROMPT",+ "TASK_EVOLVE_PROMPT",+ "Task",+ "TaskManager",+]diff --git a/camel/tasks/task.py b/camel/tasks/task.pynew file mode 100644index 000000000..2e7213b48--- /dev/null+++ b/camel/tasks/task.py@@ -0,0 +1,409 @@+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========+# Licensed under the Apache License, Version 2.0 (the āLicenseā);+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an āAS ISā BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========++import re+from enum import Enum+from typing import Callable, Dict, List, Literal, Optional, Union++from pydantic import BaseModel++from camel.agents import ChatAgent+from camel.messages import BaseMessage+from camel.prompts import TextPrompt++from .task_prompt import (+ TASK_COMPOSE_PROMPT,+ TASK_DECOMPOSE_PROMPT,+ TASK_EVOLVE_PROMPT,+)+++def parse_response(+ response: str, task_id: Optional[str] = None+) -> List["Task"]:+ r"""Parse Tasks from a response.++ Args:+ response (str): The model response.+ task_id (str, optional): a parent task id,+ the default value is "0"++ Returns:+ List[Task]: A list of tasks which is :obj:`Task` instance.+ """+ pattern = "<task>(.*?)</task>"+ tasks_content = re.findall(pattern, response, re.DOTALL)++ tasks = []+ if task_id is None:+ task_id = "0"+ for i, content in enumerate(tasks_content):+ tasks.append(Task(content=content.strip(), id=f"{task_id}.{i}"))+ return tasks+++class TaskState(str, Enum):+ OPEN = "OPEN"+ RUNNING = "RUNNING"+ DONE = "DONE"+ FAILED = "FAILED"+ DELETED = "DELETED"++ @classmethod+ def states(cls):+ return [s.value for s in cls]+++class Task(BaseModel):+ r"""Task is specific assignment that can be passed to a agent.++ Attributes:+ content: string content for task.+ id: An unique string identifier for the task. This should+ ideally be provided by the provider/model which created the task.+ state: The state which should be OPEN, RUNNING, DONE or DELETED.+ type: task type+ parent: The parent task, None for root task.+ subtasks: The childrent sub-tasks for the task.+ result: The answer for the task.+ """++ content: str++ id: str = ""++ state: TaskState = TaskState.OPEN++ type: Optional[str] = None++ parent: Optional["Task"] = None++ subtasks: List["Task"] = []++ result: Optional[str] = ""++ @classmethod+ def from_message(cls, message: BaseMessage) -> "Task":+ r"""Create a task from a message.++ Args:+ message (BaseMessage): The message to the task.++ Returns:+ Task+ """+ return cls(content=message.content, id="0")++ @staticmethod+ def to_message():+ r"""Convert a Task to a Message."""+ # TODO+ pass++ def reset(self):+ r"""Reset Task to initial state."""+ self.state = TaskState.OPEN+ self.result = ""++ def update_result(self, result: str):+ r"""Set task result and mark the task as DONE.++ Args:+ result (str): The task result.+ """+ self.result = result+ self.set_state(TaskState.DONE)++ def set_id(self, id: str):+ self.id = id++ def set_state(self, state: TaskState):+ r"""Recursively set the state of the task and its subtasks.++ Args:+ state (TaskState): The giving state.+ """+ self.state = state+ if state == TaskState.DONE:+ for subtask in self.subtasks:+ if subtask.state != TaskState.DELETED:+ subtask.set_state(state)+ elif state == TaskState.RUNNING and self.parent:+ self.parent.set_state(state)++ def add_subtask(self, task: "Task"):+ task.parent = self+ self.subtasks.append(task)++ def remove_subtask(self, id: str):+ self.subtasks = [task for task in self.subtasks if task.id != id]++ def get_running_task(self) -> Optional["Task"]:+ r"""Get RUNNING task."""+ for sub in self.subtasks:+ if sub.state == TaskState.RUNNING:+ return sub.get_running_task()+ if self.state == TaskState.RUNNING:+ return self+ return None++ def to_string(self, indent: str = "", state: bool = False) -> str:+ r"""Convert task to a sting.++ Args:+ indent (str): The ident for hierarchical tasks.+ state (bool): Include or not task state.++ Returns:+ str: The printable task string.+ """+ if state:+ _str = f"{indent}[{self.state}] Task {self.id}: {self.content}\n"+ else:+ _str = f"{indent}Task {self.id}: {self.content}\n"+ for subtask in self.subtasks:+ _str += subtask.to_string(indent + " ", state)+ return _str++ def get_result(self, indent: str = "") -> str:+ r"""Get task result to a sting.++ Args:+ indent (str): The ident for hierarchical tasks.++ Returns:+ str: The printable task string.+ """+ _str = f"{indent}Task {self.id} result: {self.result}\n"+ for subtask in self.subtasks:+ _str += subtask.get_result(indent + " ")+ return _str++ def decompose(+ self,+ agent: ChatAgent,+ template: TextPrompt = TASK_DECOMPOSE_PROMPT,+ task_parser: Callable[[str, str], List["Task"]] = parse_response,+ ) -> List["Task"]:+ r"""Decompose a task to a list of sub-tasks.+ It can be used for data generation and planner of agent.++ Args:+ agent (ChatAgent): An agent that used to decompose the task.+ template (TextPrompt): The prompt template to decompose+ task. If not provided, the default template will be used.+ task_parser (Callable[[str, str], List[Task]], optional): A+ function to extract Task from response. If not provided,+ the default parse_response will be used.++ Returns:+ List[Task]: A list of tasks which are :obj:`Task` instance.+ """++ role_name = agent.role_name+ content = template.format(+ role_name=role_name,+ content=self.content,+ )+ msg = BaseMessage.make_user_message(+ role_name=role_name, content=content+ )+ response = agent.step(msg)+ tasks = task_parser(response.msg.content, self.id)+ return tasks++ def compose(+ self,+ agent: ChatAgent,+ template: TextPrompt = TASK_COMPOSE_PROMPT,+ result_parser: Optional[Callable[[str], str]] = None,+ ):+ r"""compose task result by the sub-tasks.++ Args:+ agent (ChatAgent): An agent that used to compose the task result.+ template (TextPrompt, optional): The prompt template to compose+ task. If not provided, the default template will be used.+ result_parser (Callable[[str, str], List[Task]], optional): A+ function to extract Task from response.+ """++ if not self.subtasks:+ return++ sub_tasks_result = self.get_result()++ role_name = agent.role_name+ content = template.format(+ role_name=role_name,+ content=self.content,+ other_results=sub_tasks_result,+ )+ msg = BaseMessage.make_user_message(+ role_name=role_name, content=content+ )+ response = agent.step(msg)+ result = response.msg.content+ if result_parser:+ result = result_parser(result)+ self.update_result(result)++ def get_depth(self) -> int:+ r"""Get current task depth."""+ if self.parent is None:+ return 1+ return 1 + self.parent.get_depth()+++class TaskManager:+ r"""TaskManager is used to manage tasks.++ Attributes:+ root_task: The root task.+ tasks: The ordered tasks.+ task_map: A map for task.id to Task.+ current_task_id: The current "RUNNING" task.id.++ Args:+ task (Task): The root Task.+ """++ def __init__(self, task: Task):+ self.root_task: Task = task+ self.current_task_id: str = task.id+ self.tasks: List[Task] = [task]+ self.task_map: Dict[str, Task] = {task.id: task}++ def gen_task_id(self) -> str:+ r"""Generate a new task id."""+ return f"{len(self.tasks)}"++ def exist(self, task_id: str) -> bool:+ r"""Check if a task with the given id exists."""+ return task_id in self.task_map++ @property+ def current_task(self) -> Optional[Task]:+ r"""Get the current task."""+ return self.task_map.get(self.current_task_id, None)++ @staticmethod+ def topological_sort(tasks: List[Task]) -> List[Task]:+ r"""Sort a list of tasks by topological way.++ Args:+ tasks (List[Task]): The giving list of tasks.++ Returns:+ The sorted list of tasks.+ """+ stack = []+ visited = set()++ # recursive visit the vertices+ def visit(task: Task):+ if task.id in visited:+ return+ visited.add(task.id)++ # go deep for dependencies+ for sub_task in task.subtasks:+ visit(sub_task)++ # add current task to stack which have no dependencies.+ stack.append(task)++ for task in tasks:+ visit(task)++ return stack++ @staticmethod+ def set_tasks_dependence(+ root: Task,+ others: List[Task],+ type: Literal["serial", "parallel"] = "parallel",+ ):+ r"""Set relationship between root task and other tasks.+ Two relationships are currently supported: serial and parallel.+ `serial` : root -> other1 -> other2+ `parallel`: root -> other1+ -> other2++ Args:+ root (Task): A root task.+ others (List[Task]): A list of tasks.+ """+ # filter the root task in the others to avoid self-loop dependence.+ others = [other for other in others if other != root]++ if len(others) == 0:+ return+ if type == "parallel":+ for other in others:+ root.add_subtask(other)+ else:+ parent = root+ for child in others:+ parent.add_subtask(child)+ parent = child++ def add_tasks(self, tasks: Union[Task, List[Task]]) -> None:+ r"""self.tasks and self.task_map will be updated by the input tasks."""+ if not tasks:+ return+ if not isinstance(tasks, List):+ tasks = [tasks]+ for task in tasks:+ assert not self.exist(task.id), f"`{task.id}` already existed."+ self.tasks = self.topological_sort(self.tasks + tasks)+ self.task_map = {task.id: task for task in self.tasks}++ def evolve(+ self,+ task: Task,+ agent: ChatAgent,+ template: Optional[TextPrompt] = None,+ task_parser: Optional[Callable[[str, str], List[Task]]] = None,+ ) -> Optional[Task]:+ r"""Evolve a task to a new task.+ Evolve is only used for data generation.++ Args:+ task (Task): A given task.+ agent (ChatAgent): An agent that used to evolve the task.+ template (TextPrompt, optional): A prompt template to evolve task.+ If not provided, the default template will be used.+ task_parser (Callable, optional): A function to extract Task from+ response. If not provided, the default parser will be used.++ Returns:+ Task: The created :obj:`Task` instance or None.+ """++ if template is None:+ template = TASK_EVOLVE_PROMPT++ role_name = agent.role_name+ content = template.format(role_name=role_name, content=task.content)+ msg = BaseMessage.make_user_message(+ role_name=role_name, content=content+ )+ response = agent.step(msg)+ if task_parser is None:+ task_parser = parse_response+ tasks = task_parser(response.msg.content, task.id)+ if tasks:+ return tasks[0]+ return Nonediff --git a/camel/tasks/task_prompt.py b/camel/tasks/task_prompt.pynew file mode 100644index 000000000..2b1b7c744--- /dev/null+++ b/camel/tasks/task_prompt.py@@ -0,0 +1,65 @@+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========+# Licensed under the Apache License, Version 2.0 (the āLicenseā);+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an āAS ISā BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========+from camel.prompts import TextPrompt++# ruff: noqa: E501+TASK_DECOMPOSE_PROMPT = TextPrompt(+ """As a Task Decomposer with the role of {role_name}, your objective is to divide the given task into subtasks.+You have been provided with the following objective:++{content}++Please format the subtasks as a numbered list within <tasks> tags, as demonstrated below:+<tasks>+<task>Subtask 1</task>+<task>Subtask 2</task>+</tasks>++Each subtask should be concise, concrete, and achievable for a {role_name}.+Ensure that the task plan is created without asking any questions.+Be specific and clear.+"""+)+++TASK_COMPOSE_PROMPT = TextPrompt(+ """As a Task composer with the role of {role_name}, your objective is to gather result from all sub tasks to get the final answer.+The root task is:++{content}++The related tasks result and status:++{other_results}++so, the final answer of the root task is:+"""+)+++TASK_EVOLVE_PROMPT = TextPrompt(+ """As a Task Creator for {role_name}, your objective is to draw inspiration from the provided task to develop an entirely new one.+The new task should fall within the same domain as the given task but be more complex and unique.+It must be reasonable, understandable, and actionable by {role_name}.+The created task must be enclosed within <task> </task> tags.+<task>+... created task+</task>++## given task+{content}++## created task+"""+)diff --git a/examples/tasks/task_generation.py b/examples/tasks/task_generation.pynew file mode 100644index 000000000..4277ee505--- /dev/null+++ b/examples/tasks/task_generation.py@@ -0,0 +1,82 @@+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========+# Licensed under the Apache License, Version 2.0 (the āLicenseā);+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an āAS ISā BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========++from camel.agents import ChatAgent+from camel.configs import ChatGPTConfig+from camel.messages import BaseMessage+from camel.models import ModelFactory+from camel.tasks import (+ Task,+ TaskManager,+)+from camel.types import (+ ModelPlatformType,+ ModelType,+)++# set up LLM model+assistant_model_config = ChatGPTConfig(+ temperature=0.0,+)++model = ModelFactory.create(+ model_platform=ModelPlatformType.OPENAI,+ model_type=ModelType.GPT_4O_MINI,+ model_config_dict=assistant_model_config.__dict__,+)++# set up agent+assistant_sys_msg = BaseMessage.make_user_message(+ role_name="Teacher",+ content=("You are a personal math tutor and programmer."),+)+agent = ChatAgent(assistant_sys_msg, model)+agent.reset()++task = Task(+ content="Weng earns $12 an hour for babysitting. Yesterday, she just did 51 minutes of babysitting. How much did she earn?",+ id="0",+)+print(task.to_string())+++task_manager = TaskManager(task)++evolved_task = task_manager.evolve(task, agent=agent)+print(evolved_task.to_string())+++new_tasks = task.decompose(agent=agent)+for t in new_tasks:+ print(t.to_string())++# ruff: noqa: E501+"""+===============================================================================+Task 0: Weng earns $12 an hour for babysitting. Yesterday, she just did 51+minutes of babysitting. How much did she earn?++Task 0.0: Weng earns $12 an hour for babysitting. However, her hourly rate+increases by $2 for every additional hour worked beyond the first hour.+Yesterday, she babysat for a total of 3 hours and 45 minutes. How much did she+earn in total for her babysitting services?++Task 0.0: Convert 51 minutes to hours.++Task 0.1: Calculate the proportion of 51 minutes to an hour.++Task 0.2: Multiply the proportion by Weng's hourly rate to find out how much+she earned for 51 minutes of babysitting.+===============================================================================+"""diff --git a/poetry.lock b/poetry.lockindex 8cbb6a965..1eb601738 100644--- a/poetry.lock+++ b/poetry.lock@@ -1,4 +1,4 @@-# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.+# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand.[[package]]name = "accelerate"@@ -1195,26 +1195,6 @@ files = [{file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"},]-[[package]]-name = "dnspython"-version = "2.6.1"-description = "DNS toolkit"-optional = false-python-versions = ">=3.8"-files = [- {file = "dnspython-2.6.1-py3-none-any.whl", hash = "sha256:5ef3b9680161f6fa89daf8ad451b5f1a33b18ae8a1c6778cdf4b43f08c0a6e50"},- {file = "dnspython-2.6.1.tar.gz", hash = "sha256:e8f0f9c23a7b7cb99ded64e6c3a6f3e701d78f50c55e002b839dea7225cff7cc"},-]--[package.extras]-dev = ["black (>=23.1.0)", "coverage (>=7.0)", "flake8 (>=7)", "mypy (>=1.8)", "pylint (>=3)", "pytest (>=7.4)", "pytest-cov (>=4.1.0)", "sphinx (>=7.2.0)", "twine (>=4.0.0)", "wheel (>=0.42.0)"]-dnssec = ["cryptography (>=41)"]-doh = ["h2 (>=4.1.0)", "httpcore (>=1.0.0)", "httpx (>=0.26.0)"]-doq = ["aioquic (>=0.9.25)"]-idna = ["idna (>=3.6)"]-trio = ["trio (>=0.23)"]-wmi = ["wmi (>=1.5.1)"]-[[package]]name = "docker"version = "7.1.0"@@ -1306,21 +1286,6 @@ timm = ">=0.9.2"torch = ">=1.12.1"torchvision = "*"-[[package]]-name = "email-validator"-version = "2.2.0"-description = "A robust email address syntax and deliverability validation library."-optional = false-python-versions = ">=3.8"-files = [- {file = "email_validator-2.2.0-py3-none-any.whl", hash = "sha256:561977c2d73ce3611850a06fa56b414621e0c8faa9d66f2611407d87465da631"},- {file = "email_validator-2.2.0.tar.gz", hash = "sha256:cb690f344c617a714f22e66ae771445a1ceb46821152df8e165c5f9a364582b7"},-]--[package.dependencies]-dnspython = ">=2.0.0"-idna = ">=2.0.0"-[[package]]name = "emoji"version = "2.12.1"@@ -1400,45 +1365,23 @@ tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipyth[[package]]name = "fastapi"-version = "0.111.1"+version = "0.112.0"description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"optional = falsepython-versions = ">=3.8"files = [- {file = "fastapi-0.111.1-py3-none-any.whl", hash = "sha256:4f51cfa25d72f9fbc3280832e84b32494cf186f50158d364a8765aabf22587bf"},- {file = "fastapi-0.111.1.tar.gz", hash = "sha256:ddd1ac34cb1f76c2e2d7f8545a4bcb5463bce4834e81abf0b189e0c359ab2413"},+ {file = "fastapi-0.112.0-py3-none-any.whl", hash = "sha256:3487ded9778006a45834b8c816ec4a48d522e2631ca9e75ec5a774f1b052f821"},+ {file = "fastapi-0.112.0.tar.gz", hash = "sha256:d262bc56b7d101d1f4e8fc0ad2ac75bb9935fec504d2b7117686cec50710cf05"},][package.dependencies]-email_validator = ">=2.0.0"-fastapi-cli = ">=0.0.2"-httpx = ">=0.23.0"-jinja2 = ">=2.11.2"pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0"-python-multipart = ">=0.0.7"starlette = ">=0.37.2,<0.38.0"typing-extensions = ">=4.8.0"-uvicorn = {version = ">=0.12.0", extras = ["standard"]}--[package.extras]-all = ["email_validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=2.11.2)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.7)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"]--[[package]]-name = "fastapi-cli"-version = "0.0.4"-description = "Run and manage FastAPI apps from the command line with FastAPI CLI. š"-optional = false-python-versions = ">=3.8"-files = [- {file = "fastapi_cli-0.0.4-py3-none-any.whl", hash = "sha256:a2552f3a7ae64058cdbb530be6fa6dbfc975dc165e4fa66d224c3d396e25e809"},- {file = "fastapi_cli-0.0.4.tar.gz", hash = "sha256:e2e9ffaffc1f7767f488d6da34b6f5a377751c996f397902eb6abb99a67bde32"},-]--[package.dependencies]-typer = ">=0.12.3"[package.extras]-standard = ["fastapi", "uvicorn[standard] (>=0.15.0)"]+all = ["email_validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=2.11.2)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.7)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"]+standard = ["email_validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "jinja2 (>=2.11.2)", "python-multipart (>=0.0.7)", "uvicorn[standard] (>=0.12.0)"][[package]]name = "fastavro"@@ -2233,54 +2176,6 @@ files = [[package.dependencies]pyparsing = {version = ">=2.4.2,<3.0.0 || >3.0.0,<3.0.1 || >3.0.1,<3.0.2 || >3.0.2,<3.0.3 || >3.0.3,<4", markers = "python_version > \"3.0\""}-[[package]]-name = "httptools"-version = "0.6.1"-description = "A collection of framework independent HTTP protocol utils."-optional = false-python-versions = ">=3.8.0"-files = [- {file = "httptools-0.6.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d2f6c3c4cb1948d912538217838f6e9960bc4a521d7f9b323b3da579cd14532f"},- {file = "httptools-0.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:00d5d4b68a717765b1fabfd9ca755bd12bf44105eeb806c03d1962acd9b8e563"},- {file = "httptools-0.6.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:639dc4f381a870c9ec860ce5c45921db50205a37cc3334e756269736ff0aac58"},- {file = "httptools-0.6.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e57997ac7fb7ee43140cc03664de5f268813a481dff6245e0075925adc6aa185"},- {file = "httptools-0.6.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0ac5a0ae3d9f4fe004318d64b8a854edd85ab76cffbf7ef5e32920faef62f142"},- {file = "httptools-0.6.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:3f30d3ce413088a98b9db71c60a6ada2001a08945cb42dd65a9a9fe228627658"},- {file = "httptools-0.6.1-cp310-cp310-win_amd64.whl", hash = "sha256:1ed99a373e327f0107cb513b61820102ee4f3675656a37a50083eda05dc9541b"},- {file = "httptools-0.6.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7a7ea483c1a4485c71cb5f38be9db078f8b0e8b4c4dc0210f531cdd2ddac1ef1"},- {file = "httptools-0.6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:85ed077c995e942b6f1b07583e4eb0a8d324d418954fc6af913d36db7c05a5a0"},- {file = "httptools-0.6.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b0bb634338334385351a1600a73e558ce619af390c2b38386206ac6a27fecfc"},- {file = "httptools-0.6.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d9ceb2c957320def533671fc9c715a80c47025139c8d1f3797477decbc6edd2"},- {file = "httptools-0.6.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:4f0f8271c0a4db459f9dc807acd0eadd4839934a4b9b892f6f160e94da309837"},- {file = "httptools-0.6.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:6a4f5ccead6d18ec072ac0b84420e95d27c1cdf5c9f1bc8fbd8daf86bd94f43d"},- {file = "httptools-0.6.1-cp311-cp311-win_amd64.whl", hash = "sha256:5cceac09f164bcba55c0500a18fe3c47df29b62353198e4f37bbcc5d591172c3"},- {file = "httptools-0.6.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:75c8022dca7935cba14741a42744eee13ba05db00b27a4b940f0d646bd4d56d0"},- {file = "httptools-0.6.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:48ed8129cd9a0d62cf4d1575fcf90fb37e3ff7d5654d3a5814eb3d55f36478c2"},- {file = "httptools-0.6.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f58e335a1402fb5a650e271e8c2d03cfa7cea46ae124649346d17bd30d59c90"},- {file = "httptools-0.6.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93ad80d7176aa5788902f207a4e79885f0576134695dfb0fefc15b7a4648d503"},- {file = "httptools-0.6.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9bb68d3a085c2174c2477eb3ffe84ae9fb4fde8792edb7bcd09a1d8467e30a84"},- {file = "httptools-0.6.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b512aa728bc02354e5ac086ce76c3ce635b62f5fbc32ab7082b5e582d27867bb"},- {file = "httptools-0.6.1-cp312-cp312-win_amd64.whl", hash = "sha256:97662ce7fb196c785344d00d638fc9ad69e18ee4bfb4000b35a52efe5adcc949"},- {file = "httptools-0.6.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:8e216a038d2d52ea13fdd9b9c9c7459fb80d78302b257828285eca1c773b99b3"},- {file = "httptools-0.6.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3e802e0b2378ade99cd666b5bffb8b2a7cc8f3d28988685dc300469ea8dd86cb"},- {file = "httptools-0.6.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4bd3e488b447046e386a30f07af05f9b38d3d368d1f7b4d8f7e10af85393db97"},- {file = "httptools-0.6.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe467eb086d80217b7584e61313ebadc8d187a4d95bb62031b7bab4b205c3ba3"},- {file = "httptools-0.6.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:3c3b214ce057c54675b00108ac42bacf2ab8f85c58e3f324a4e963bbc46424f4"},- {file = "httptools-0.6.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8ae5b97f690badd2ca27cbf668494ee1b6d34cf1c464271ef7bfa9ca6b83ffaf"},- {file = "httptools-0.6.1-cp38-cp38-win_amd64.whl", hash = "sha256:405784577ba6540fa7d6ff49e37daf104e04f4b4ff2d1ac0469eaa6a20fde084"},- {file = "httptools-0.6.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:95fb92dd3649f9cb139e9c56604cc2d7c7bf0fc2e7c8d7fbd58f96e35eddd2a3"},- {file = "httptools-0.6.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dcbab042cc3ef272adc11220517278519adf8f53fd3056d0e68f0a6f891ba94e"},- {file = "httptools-0.6.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cf2372e98406efb42e93bfe10f2948e467edfd792b015f1b4ecd897903d3e8d"},- {file = "httptools-0.6.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:678fcbae74477a17d103b7cae78b74800d795d702083867ce160fc202104d0da"},- {file = "httptools-0.6.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e0b281cf5a125c35f7f6722b65d8542d2e57331be573e9e88bc8b0115c4a7a81"},- {file = "httptools-0.6.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:95658c342529bba4e1d3d2b1a874db16c7cca435e8827422154c9da76ac4e13a"},- {file = "httptools-0.6.1-cp39-cp39-win_amd64.whl", hash = "sha256:7ebaec1bf683e4bf5e9fbb49b8cc36da482033596a415b3e4ebab5a4c0d7ec5e"},- {file = "httptools-0.6.1.tar.gz", hash = "sha256:c6e26c30455600b95d94b1b836085138e82f177351454ee841c148f93a9bad5a"},-]--[package.extras]-test = ["Cython (>=0.29.24,<0.30.0)"]-[[package]]name = "httpx"version = "0.27.0"@@ -3324,30 +3219,6 @@ importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""}docs = ["mdx-gh-links (>=0.2)", "mkdocs (>=1.5)", "mkdocs-gen-files", "mkdocs-literate-nav", "mkdocs-nature (>=0.6)", "mkdocs-section-index", "mkdocstrings[python]"]testing = ["coverage", "pyyaml"]-[[package]]-name = "markdown-it-py"-version = "3.0.0"-description = "Python port of markdown-it. Markdown parsing, done right!"-optional = false-python-versions = ">=3.8"-files = [- {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"},- {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"},-]--[package.dependencies]-mdurl = ">=0.1,<1.0"--[package.extras]-benchmarking = ["psutil", "pytest", "pytest-benchmark"]-code-style = ["pre-commit (>=3.0,<4.0)"]-compare = ["commonmark (>=0.9,<1.0)", "markdown (>=3.4,<4.0)", "mistletoe (>=1.0,<2.0)", "mistune (>=2.0,<3.0)", "panflute (>=2.3,<3.0)"]-linkify = ["linkify-it-py (>=1,<3)"]-plugins = ["mdit-py-plugins"]-profiling = ["gprof2dot"]-rtd = ["jupyter_sphinx", "mdit-py-plugins", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"]-testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"]-[[package]]name = "markupsafe"version = "2.1.5"@@ -3503,17 +3374,6 @@ files = [[package.dependencies]traitlets = "*"-[[package]]-name = "mdurl"-version = "0.1.2"-description = "Markdown URL utilities"-optional = false-python-versions = ">=3.7"-files = [- {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"},- {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"},-]-[[package]]name = "milvus-lite"version = "2.4.8"@@ -4238,13 +4098,13 @@ sympy = "*"[[package]]name = "openai"-version = "1.37.1"+version = "1.37.2"description = "The official Python library for the openai API"optional = falsepython-versions = ">=3.7.1"files = [- {file = "openai-1.37.1-py3-none-any.whl", hash = "sha256:9a6adda0d6ae8fce02d235c5671c399cfa40d6a281b3628914c7ebf244888ee3"},- {file = "openai-1.37.1.tar.gz", hash = "sha256:faf87206785a6b5d9e34555d6a3242482a6852bc802e453e2a891f68ee04ce55"},+ {file = "openai-1.37.2-py3-none-any.whl", hash = "sha256:22dfcf48cd9ff1a6b1d8de09121261bc72315515a9faadad541be93a8bb1e961"},+ {file = "openai-1.37.2.tar.gz", hash = "sha256:fd97cb235cfce0f7c902c64e58a5cd9fea19e7c180d9a4e2a2b8e533dbd9f424"},][package.dependencies]@@ -5274,12 +5134,14 @@ files = [{file = "PyMuPDF-1.24.9-cp312-none-win_amd64.whl", hash = "sha256:e2828a79415ae3dd90c629697ace51db7f1e81f426fc2fc034c2151dbe58be6e"},{file = "PyMuPDF-1.24.9-cp38-none-macosx_10_9_x86_64.whl", hash = "sha256:241913d0c76aacb05acdd8a0e82b1105883ffe6ef3bb4d9742b41d3c5e84d2db"},{file = "PyMuPDF-1.24.9-cp38-none-macosx_11_0_arm64.whl", hash = "sha256:ff70e26625b6cdd036e2c63b5d6c1897949c0e8b205cd756276f27baadaad340"},+ {file = "PyMuPDF-1.24.9-cp38-none-manylinux2014_aarch64.whl", hash = "sha256:8e29bc817afad511072371f24624c7c3b7485a9e656b6a65dc58fecdf5043b08"},{file = "PyMuPDF-1.24.9-cp38-none-manylinux2014_x86_64.whl", hash = "sha256:d17ec6920f91c43b6e777a017f3aaf44b205a3216771db9e8aa46e78a703f8f6"},{file = "PyMuPDF-1.24.9-cp38-none-musllinux_1_2_x86_64.whl", hash = "sha256:5cec9d17fdcbd83fa2c90190c22f652a0a51275cf75a29068eea025fff076829"},{file = "PyMuPDF-1.24.9-cp38-none-win32.whl", hash = "sha256:4f7b19f5c0026db49b7be17901728ed15761c5aa2031f04b01f9eb2e54f1b50e"},{file = "PyMuPDF-1.24.9-cp38-none-win_amd64.whl", hash = "sha256:e4c867f1cde68ff0e9c7889ea27c4c2c67df80e776f82619888bb69d1e1b27cf"},{file = "PyMuPDF-1.24.9-cp39-none-macosx_10_9_x86_64.whl", hash = "sha256:b4f85c24050e3778be6c7c1f4d4965fd4385281264798df7b4301b78895053fd"},{file = "PyMuPDF-1.24.9-cp39-none-macosx_11_0_arm64.whl", hash = "sha256:4e807010ef4e63cfb70dd88fe1fcd1d7e2b4e62ffa2b1dc53b35bc18bf939d8e"},+ {file = "PyMuPDF-1.24.9-cp39-none-manylinux2014_aarch64.whl", hash = "sha256:5dac888cc16981e385c886c26de6aabf914059215e028d14cd67767ff0c1288c"},{file = "PyMuPDF-1.24.9-cp39-none-manylinux2014_x86_64.whl", hash = "sha256:de55817c02e06ff75233ce2487cc5ebcbf585acd694bb69500825ee37789ac79"},{file = "PyMuPDF-1.24.9-cp39-none-musllinux_1_2_x86_64.whl", hash = "sha256:49cb22196f11c2327f6345554db48cfb2e31ed4f073ca6a872f21ddc4b0619c1"},{file = "PyMuPDF-1.24.9-cp39-none-win32.whl", hash = "sha256:46b1f84816c666e1c82f4249c1e815e92c462633255d72da20751eaad125d0f0"},@@ -5553,7 +5415,7 @@ typing-extensions = ">=4.9.0"name = "python-dotenv"version = "1.0.1"description = "Read key-value pairs from a .env file and set them as environment variables"-optional = false+optional = truepython-versions = ">=3.8"files = [{file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"},@@ -6163,24 +6025,6 @@ files = [[package.dependencies]six = "*"-[[package]]-name = "rich"-version = "13.7.1"-description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"-optional = false-python-versions = ">=3.7.0"-files = [- {file = "rich-13.7.1-py3-none-any.whl", hash = "sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222"},- {file = "rich-13.7.1.tar.gz", hash = "sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432"},-]--[package.dependencies]-markdown-it-py = ">=2.2.0"-pygments = ">=2.13.0,<3.0.0"--[package.extras]-jupyter = ["ipywidgets (>=7.5.1,<9)"]-[[package]]name = "rpds-py"version = "0.19.1"@@ -6747,17 +6591,6 @@ files = [{file = "sgmllib3k-1.0.0.tar.gz", hash = "sha256:7868fb1c8bfa764c1ac563d3cf369c381d1325d36124933a726f29fcdaa812e9"},]-[[package]]-name = "shellingham"-version = "1.5.4"-description = "Tool to Detect Surrounding Shell"-optional = false-python-versions = ">=3.7"-files = [- {file = "shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686"},- {file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"},-]-[[package]]name = "six"version = "1.16.0"@@ -7378,6 +7211,11 @@ description = "image and video datasets and models for torch deep learning"optional = truepython-versions = ">=3.8"files = [+ {file = "torchvision-0.19.0-1-cp310-cp310-win_amd64.whl", hash = "sha256:6ed066aae5c50465d7c4761357aefe5dbd2eb7075a33ab8c14b352fc2353ad4c"},+ {file = "torchvision-0.19.0-1-cp311-cp311-win_amd64.whl", hash = "sha256:6b1bce2e4c003d890a18f14ff289528707d918e38539ff890ef02aa31dae1b56"},+ {file = "torchvision-0.19.0-1-cp312-cp312-win_amd64.whl", hash = "sha256:13aee7a46e049c8c1e7d35a0394b0587a7e62ff3d1a822cd2bbbacb675ac4a09"},+ {file = "torchvision-0.19.0-1-cp38-cp38-win_amd64.whl", hash = "sha256:2acc436d043d4f81b3bc6929cbfa4ef1cdae4d8a0b04ec72ec30a497e9a38179"},+ {file = "torchvision-0.19.0-1-cp39-cp39-win_amd64.whl", hash = "sha256:b5f70f5a8bd9c8b00a076bf466b39b5cd679ef62587c47cc048adb04d9c5f155"},{file = "torchvision-0.19.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ec874ef85dcb24c69e600f6e276af892c80cde3ffdaeb7275efda463242bc2a8"},{file = "torchvision-0.19.0-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:106842b1e475b14d9a04ee0d6f5477d43100e3bb78e9d31e37422384d0d84179"},{file = "torchvision-0.19.0-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:d467d434005fd05a227a2ba7af4c591bb67e6d4a97bbd06eda8da83f43e9fd07"},@@ -7559,23 +7397,6 @@ build = ["cmake (>=3.20)", "lit"]tests = ["autopep8", "flake8", "isort", "llnl-hatchet", "numpy", "pytest", "scipy (>=1.7.1)"]tutorials = ["matplotlib", "pandas", "tabulate"]-[[package]]-name = "typer"-version = "0.12.3"-description = "Typer, build great CLIs. Easy to code. Based on Python type hints."-optional = false-python-versions = ">=3.7"-files = [- {file = "typer-0.12.3-py3-none-any.whl", hash = "sha256:070d7ca53f785acbccba8e7d28b08dcd88f79f1fbda035ade0aecec71ca5c914"},- {file = "typer-0.12.3.tar.gz", hash = "sha256:49e73131481d804288ef62598d97a1ceef3058905aa536a1134f90891ba35482"},-]--[package.dependencies]-click = ">=8.0.0"-rich = ">=10.11.0"-shellingham = ">=1.3.0"-typing-extensions = ">=3.7.4.3"-[[package]]name = "types-colorama"version = "0.4.15.20240311"@@ -7978,63 +7799,12 @@ files = [[package.dependencies]click = ">=7.0"-colorama = {version = ">=0.4", optional = true, markers = "sys_platform == \"win32\" and extra == \"standard\""}h11 = ">=0.8"-httptools = {version = ">=0.5.0", optional = true, markers = "extra == \"standard\""}-python-dotenv = {version = ">=0.13", optional = true, markers = "extra == \"standard\""}-pyyaml = {version = ">=5.1", optional = true, markers = "extra == \"standard\""}typing-extensions = {version = ">=4.0", markers = "python_version < \"3.11\""}-uvloop = {version = ">=0.14.0,<0.15.0 || >0.15.0,<0.15.1 || >0.15.1", optional = true, markers = "(sys_platform != \"win32\" and sys_platform != \"cygwin\") and platform_python_implementation != \"PyPy\" and extra == \"standard\""}-watchfiles = {version = ">=0.13", optional = true, markers = "extra == \"standard\""}-websockets = {version = ">=10.4", optional = true, markers = "extra == \"standard\""}[package.extras]standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "watchfiles (>=0.13)", "websockets (>=10.4)"]-[[package]]-name = "uvloop"-version = "0.19.0"-description = "Fast implementation of asyncio event loop on top of libuv"-optional = false-python-versions = ">=3.8.0"-files = [- {file = "uvloop-0.19.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:de4313d7f575474c8f5a12e163f6d89c0a878bc49219641d49e6f1444369a90e"},- {file = "uvloop-0.19.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5588bd21cf1fcf06bded085f37e43ce0e00424197e7c10e77afd4bbefffef428"},- {file = "uvloop-0.19.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7b1fd71c3843327f3bbc3237bedcdb6504fd50368ab3e04d0410e52ec293f5b8"},- {file = "uvloop-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a05128d315e2912791de6088c34136bfcdd0c7cbc1cf85fd6fd1bb321b7c849"},- {file = "uvloop-0.19.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:cd81bdc2b8219cb4b2556eea39d2e36bfa375a2dd021404f90a62e44efaaf957"},- {file = "uvloop-0.19.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:5f17766fb6da94135526273080f3455a112f82570b2ee5daa64d682387fe0dcd"},- {file = "uvloop-0.19.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4ce6b0af8f2729a02a5d1575feacb2a94fc7b2e983868b009d51c9a9d2149bef"},- {file = "uvloop-0.19.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:31e672bb38b45abc4f26e273be83b72a0d28d074d5b370fc4dcf4c4eb15417d2"},- {file = "uvloop-0.19.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:570fc0ed613883d8d30ee40397b79207eedd2624891692471808a95069a007c1"},- {file = "uvloop-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5138821e40b0c3e6c9478643b4660bd44372ae1e16a322b8fc07478f92684e24"},- {file = "uvloop-0.19.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:91ab01c6cd00e39cde50173ba4ec68a1e578fee9279ba64f5221810a9e786533"},- {file = "uvloop-0.19.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:47bf3e9312f63684efe283f7342afb414eea4d3011542155c7e625cd799c3b12"},- {file = "uvloop-0.19.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:da8435a3bd498419ee8c13c34b89b5005130a476bda1d6ca8cfdde3de35cd650"},- {file = "uvloop-0.19.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:02506dc23a5d90e04d4f65c7791e65cf44bd91b37f24cfc3ef6cf2aff05dc7ec"},- {file = "uvloop-0.19.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2693049be9d36fef81741fddb3f441673ba12a34a704e7b4361efb75cf30befc"},- {file = "uvloop-0.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7010271303961c6f0fe37731004335401eb9075a12680738731e9c92ddd96ad6"},- {file = "uvloop-0.19.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:5daa304d2161d2918fa9a17d5635099a2f78ae5b5960e742b2fcfbb7aefaa593"},- {file = "uvloop-0.19.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:7207272c9520203fea9b93843bb775d03e1cf88a80a936ce760f60bb5add92f3"},- {file = "uvloop-0.19.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:78ab247f0b5671cc887c31d33f9b3abfb88d2614b84e4303f1a63b46c046c8bd"},- {file = "uvloop-0.19.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:472d61143059c84947aa8bb74eabbace30d577a03a1805b77933d6bd13ddebbd"},- {file = "uvloop-0.19.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45bf4c24c19fb8a50902ae37c5de50da81de4922af65baf760f7c0c42e1088be"},- {file = "uvloop-0.19.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:271718e26b3e17906b28b67314c45d19106112067205119dddbd834c2b7ce797"},- {file = "uvloop-0.19.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:34175c9fd2a4bc3adc1380e1261f60306344e3407c20a4d684fd5f3be010fa3d"},- {file = "uvloop-0.19.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e27f100e1ff17f6feeb1f33968bc185bf8ce41ca557deee9d9bbbffeb72030b7"},- {file = "uvloop-0.19.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:13dfdf492af0aa0a0edf66807d2b465607d11c4fa48f4a1fd41cbea5b18e8e8b"},- {file = "uvloop-0.19.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6e3d4e85ac060e2342ff85e90d0c04157acb210b9ce508e784a944f852a40e67"},- {file = "uvloop-0.19.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8ca4956c9ab567d87d59d49fa3704cf29e37109ad348f2d5223c9bf761a332e7"},- {file = "uvloop-0.19.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f467a5fd23b4fc43ed86342641f3936a68ded707f4627622fa3f82a120e18256"},- {file = "uvloop-0.19.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:492e2c32c2af3f971473bc22f086513cedfc66a130756145a931a90c3958cb17"},- {file = "uvloop-0.19.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2df95fca285a9f5bfe730e51945ffe2fa71ccbfdde3b0da5772b4ee4f2e770d5"},- {file = "uvloop-0.19.0.tar.gz", hash = "sha256:0246f4fd1bf2bf702e06b0d45ee91677ee5c31242f39aab4ea6fe0c51aedd0fd"},-]--[package.extras]-docs = ["Sphinx (>=4.1.2,<4.2.0)", "sphinx-rtd-theme (>=0.5.2,<0.6.0)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)"]-test = ["Cython (>=0.29.36,<0.30.0)", "aiohttp (==3.9.0b0)", "aiohttp (>=3.8.1)", "flake8 (>=5.0,<6.0)", "mypy (>=0.800)", "psutil", "pyOpenSSL (>=23.0.0,<23.1.0)", "pycodestyle (>=2.9.0,<2.10.0)"]-[[package]]name = "virtualenv"version = "20.26.3"@@ -8055,93 +7825,6 @@ platformdirs = ">=3.9.1,<5"docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"]test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"]-[[package]]-name = "watchfiles"-version = "0.22.0"-description = "Simple, modern and high performance file watching and code reload in python."-optional = false-python-versions = ">=3.8"-files = [- {file = "watchfiles-0.22.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:da1e0a8caebf17976e2ffd00fa15f258e14749db5e014660f53114b676e68538"},- {file = "watchfiles-0.22.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:61af9efa0733dc4ca462347becb82e8ef4945aba5135b1638bfc20fad64d4f0e"},- {file = "watchfiles-0.22.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d9188979a58a096b6f8090e816ccc3f255f137a009dd4bbec628e27696d67c1"},- {file = "watchfiles-0.22.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2bdadf6b90c099ca079d468f976fd50062905d61fae183f769637cb0f68ba59a"},- {file = "watchfiles-0.22.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:067dea90c43bf837d41e72e546196e674f68c23702d3ef80e4e816937b0a3ffd"},- {file = "watchfiles-0.22.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bbf8a20266136507abf88b0df2328e6a9a7c7309e8daff124dda3803306a9fdb"},- {file = "watchfiles-0.22.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1235c11510ea557fe21be5d0e354bae2c655a8ee6519c94617fe63e05bca4171"},- {file = "watchfiles-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c2444dc7cb9d8cc5ab88ebe792a8d75709d96eeef47f4c8fccb6df7c7bc5be71"},- {file = "watchfiles-0.22.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:c5af2347d17ab0bd59366db8752d9e037982e259cacb2ba06f2c41c08af02c39"},- {file = "watchfiles-0.22.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:9624a68b96c878c10437199d9a8b7d7e542feddda8d5ecff58fdc8e67b460848"},- {file = "watchfiles-0.22.0-cp310-none-win32.whl", hash = "sha256:4b9f2a128a32a2c273d63eb1fdbf49ad64852fc38d15b34eaa3f7ca2f0d2b797"},- {file = "watchfiles-0.22.0-cp310-none-win_amd64.whl", hash = "sha256:2627a91e8110b8de2406d8b2474427c86f5a62bf7d9ab3654f541f319ef22bcb"},- {file = "watchfiles-0.22.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8c39987a1397a877217be1ac0fb1d8b9f662c6077b90ff3de2c05f235e6a8f96"},- {file = "watchfiles-0.22.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a927b3034d0672f62fb2ef7ea3c9fc76d063c4b15ea852d1db2dc75fe2c09696"},- {file = "watchfiles-0.22.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:052d668a167e9fc345c24203b104c313c86654dd6c0feb4b8a6dfc2462239249"},- {file = "watchfiles-0.22.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e45fb0d70dda1623a7045bd00c9e036e6f1f6a85e4ef2c8ae602b1dfadf7550"},- {file = "watchfiles-0.22.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c49b76a78c156979759d759339fb62eb0549515acfe4fd18bb151cc07366629c"},- {file = "watchfiles-0.22.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4a65474fd2b4c63e2c18ac67a0c6c66b82f4e73e2e4d940f837ed3d2fd9d4da"},- {file = "watchfiles-0.22.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1cc0cba54f47c660d9fa3218158b8963c517ed23bd9f45fe463f08262a4adae1"},- {file = "watchfiles-0.22.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94ebe84a035993bb7668f58a0ebf998174fb723a39e4ef9fce95baabb42b787f"},- {file = "watchfiles-0.22.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e0f0a874231e2839abbf473256efffe577d6ee2e3bfa5b540479e892e47c172d"},- {file = "watchfiles-0.22.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:213792c2cd3150b903e6e7884d40660e0bcec4465e00563a5fc03f30ea9c166c"},- {file = "watchfiles-0.22.0-cp311-none-win32.whl", hash = "sha256:b44b70850f0073b5fcc0b31ede8b4e736860d70e2dbf55701e05d3227a154a67"},- {file = "watchfiles-0.22.0-cp311-none-win_amd64.whl", hash = "sha256:00f39592cdd124b4ec5ed0b1edfae091567c72c7da1487ae645426d1b0ffcad1"},- {file = "watchfiles-0.22.0-cp311-none-win_arm64.whl", hash = "sha256:3218a6f908f6a276941422b035b511b6d0d8328edd89a53ae8c65be139073f84"},- {file = "watchfiles-0.22.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:c7b978c384e29d6c7372209cbf421d82286a807bbcdeb315427687f8371c340a"},- {file = "watchfiles-0.22.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bd4c06100bce70a20c4b81e599e5886cf504c9532951df65ad1133e508bf20be"},- {file = "watchfiles-0.22.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:425440e55cd735386ec7925f64d5dde392e69979d4c8459f6bb4e920210407f2"},- {file = "watchfiles-0.22.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:68fe0c4d22332d7ce53ad094622b27e67440dacefbaedd29e0794d26e247280c"},- {file = "watchfiles-0.22.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a8a31bfd98f846c3c284ba694c6365620b637debdd36e46e1859c897123aa232"},- {file = "watchfiles-0.22.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc2e8fe41f3cac0660197d95216c42910c2b7e9c70d48e6d84e22f577d106fc1"},- {file = "watchfiles-0.22.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55b7cc10261c2786c41d9207193a85c1db1b725cf87936df40972aab466179b6"},- {file = "watchfiles-0.22.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28585744c931576e535860eaf3f2c0ec7deb68e3b9c5a85ca566d69d36d8dd27"},- {file = "watchfiles-0.22.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:00095dd368f73f8f1c3a7982a9801190cc88a2f3582dd395b289294f8975172b"},- {file = "watchfiles-0.22.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:52fc9b0dbf54d43301a19b236b4a4614e610605f95e8c3f0f65c3a456ffd7d35"},- {file = "watchfiles-0.22.0-cp312-none-win32.whl", hash = "sha256:581f0a051ba7bafd03e17127735d92f4d286af941dacf94bcf823b101366249e"},- {file = "watchfiles-0.22.0-cp312-none-win_amd64.whl", hash = "sha256:aec83c3ba24c723eac14225194b862af176d52292d271c98820199110e31141e"},- {file = "watchfiles-0.22.0-cp312-none-win_arm64.whl", hash = "sha256:c668228833c5619f6618699a2c12be057711b0ea6396aeaece4ded94184304ea"},- {file = "watchfiles-0.22.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d47e9ef1a94cc7a536039e46738e17cce058ac1593b2eccdede8bf72e45f372a"},- {file = "watchfiles-0.22.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:28f393c1194b6eaadcdd8f941307fc9bbd7eb567995232c830f6aef38e8a6e88"},- {file = "watchfiles-0.22.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd64f3a4db121bc161644c9e10a9acdb836853155a108c2446db2f5ae1778c3d"},- {file = "watchfiles-0.22.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2abeb79209630da981f8ebca30a2c84b4c3516a214451bfc5f106723c5f45843"},- {file = "watchfiles-0.22.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4cc382083afba7918e32d5ef12321421ef43d685b9a67cc452a6e6e18920890e"},- {file = "watchfiles-0.22.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d048ad5d25b363ba1d19f92dcf29023988524bee6f9d952130b316c5802069cb"},- {file = "watchfiles-0.22.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:103622865599f8082f03af4214eaff90e2426edff5e8522c8f9e93dc17caee13"},- {file = "watchfiles-0.22.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3e1f3cf81f1f823e7874ae563457828e940d75573c8fbf0ee66818c8b6a9099"},- {file = "watchfiles-0.22.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:8597b6f9dc410bdafc8bb362dac1cbc9b4684a8310e16b1ff5eee8725d13dcd6"},- {file = "watchfiles-0.22.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0b04a2cbc30e110303baa6d3ddce8ca3664bc3403be0f0ad513d1843a41c97d1"},- {file = "watchfiles-0.22.0-cp38-none-win32.whl", hash = "sha256:b610fb5e27825b570554d01cec427b6620ce9bd21ff8ab775fc3a32f28bba63e"},- {file = "watchfiles-0.22.0-cp38-none-win_amd64.whl", hash = "sha256:fe82d13461418ca5e5a808a9e40f79c1879351fcaeddbede094028e74d836e86"},- {file = "watchfiles-0.22.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:3973145235a38f73c61474d56ad6199124e7488822f3a4fc97c72009751ae3b0"},- {file = "watchfiles-0.22.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:280a4afbc607cdfc9571b9904b03a478fc9f08bbeec382d648181c695648202f"},- {file = "watchfiles-0.22.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a0d883351a34c01bd53cfa75cd0292e3f7e268bacf2f9e33af4ecede7e21d1d"},- {file = "watchfiles-0.22.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9165bcab15f2b6d90eedc5c20a7f8a03156b3773e5fb06a790b54ccecdb73385"},- {file = "watchfiles-0.22.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dc1b9b56f051209be458b87edb6856a449ad3f803315d87b2da4c93b43a6fe72"},- {file = "watchfiles-0.22.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8dc1fc25a1dedf2dd952909c8e5cb210791e5f2d9bc5e0e8ebc28dd42fed7562"},- {file = "watchfiles-0.22.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dc92d2d2706d2b862ce0568b24987eba51e17e14b79a1abcd2edc39e48e743c8"},- {file = "watchfiles-0.22.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97b94e14b88409c58cdf4a8eaf0e67dfd3ece7e9ce7140ea6ff48b0407a593ec"},- {file = "watchfiles-0.22.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:96eec15e5ea7c0b6eb5bfffe990fc7c6bd833acf7e26704eb18387fb2f5fd087"},- {file = "watchfiles-0.22.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:28324d6b28bcb8d7c1041648d7b63be07a16db5510bea923fc80b91a2a6cbed6"},- {file = "watchfiles-0.22.0-cp39-none-win32.whl", hash = "sha256:8c3e3675e6e39dc59b8fe5c914a19d30029e36e9f99468dddffd432d8a7b1c93"},- {file = "watchfiles-0.22.0-cp39-none-win_amd64.whl", hash = "sha256:25c817ff2a86bc3de3ed2df1703e3d24ce03479b27bb4527c57e722f8554d971"},- {file = "watchfiles-0.22.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b810a2c7878cbdecca12feae2c2ae8af59bea016a78bc353c184fa1e09f76b68"},- {file = "watchfiles-0.22.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:f7e1f9c5d1160d03b93fc4b68a0aeb82fe25563e12fbcdc8507f8434ab6f823c"},- {file = "watchfiles-0.22.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:030bc4e68d14bcad2294ff68c1ed87215fbd9a10d9dea74e7cfe8a17869785ab"},- {file = "watchfiles-0.22.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ace7d060432acde5532e26863e897ee684780337afb775107c0a90ae8dbccfd2"},- {file = "watchfiles-0.22.0-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5834e1f8b71476a26df97d121c0c0ed3549d869124ed2433e02491553cb468c2"},- {file = "watchfiles-0.22.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:0bc3b2f93a140df6806c8467c7f51ed5e55a931b031b5c2d7ff6132292e803d6"},- {file = "watchfiles-0.22.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8fdebb655bb1ba0122402352b0a4254812717a017d2dc49372a1d47e24073795"},- {file = "watchfiles-0.22.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0c8e0aa0e8cc2a43561e0184c0513e291ca891db13a269d8d47cb9841ced7c71"},- {file = "watchfiles-0.22.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2f350cbaa4bb812314af5dab0eb8d538481e2e2279472890864547f3fe2281ed"},- {file = "watchfiles-0.22.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7a74436c415843af2a769b36bf043b6ccbc0f8d784814ba3d42fc961cdb0a9dc"},- {file = "watchfiles-0.22.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:00ad0bcd399503a84cc688590cdffbe7a991691314dde5b57b3ed50a41319a31"},- {file = "watchfiles-0.22.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72a44e9481afc7a5ee3291b09c419abab93b7e9c306c9ef9108cb76728ca58d2"},- {file = "watchfiles-0.22.0.tar.gz", hash = "sha256:988e981aaab4f3955209e7e28c7794acdb690be1efa7f16f8ea5aba7ffdadacb"},-]--[package.dependencies]-anyio = ">=3.0.0"-[[package]]name = "wcwidth"version = "0.2.13"diff --git a/test/tasks/test_task.py b/test/tasks/test_task.pynew file mode 100644index 000000000..32fa15048--- /dev/null+++ b/test/tasks/test_task.py@@ -0,0 +1,80 @@+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========+# Licensed under the Apache License, Version 2.0 (the āLicenseā);+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an āAS ISā BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========+from camel.tasks import Task, TaskManager+++def test_task():+ task = Task(content="a start task", id="0")+ sub_task_1 = Task(content="a sub task 1", id="1")+ sub_task_2 = Task(content="a sub task 2", id="2")+ task.add_subtask(sub_task_1)+ task.add_subtask(sub_task_2)+ task.set_state("DONE")++ print(task.to_string())+ assert task.state == "DONE"++ task.set_state("RUNNING")+ print(task.to_string(state=True))++ print(task.get_result())+++def test_task_management():+ """+ Task 0: a start task+ Task 1: a sub task 1+ Task 2: a sub task 2+ Task 2.1: a sub task of task 2+ Task 2.2: a sub task of task 2+ Task 3: a sub task 3+ """+ root_task = Task(content="a start task", id="0")+ sub_task_1 = Task(content="a sub task 1", id="1")+ sub_task_2 = Task(content="a sub task 2", id="2")+ sub_task_3 = Task(content="a sub task 3", id="3")+ sub_task_2_1 = Task(content="a sub task of task 2", id="2.1")+ sub_task_2_2 = Task(content="a sub task of task 2", id="2.2")+ root_task.add_subtask(sub_task_1)+ root_task.add_subtask(sub_task_2)+ root_task.add_subtask(sub_task_3)+ sub_task_2.add_subtask(sub_task_2_1)+ sub_task_2.add_subtask(sub_task_2_2)++ print("\n===\n" + root_task.to_string() + "\n===\n")++ manager = TaskManager(root_task)+ new_tasks = [+ sub_task_1,+ sub_task_2,+ sub_task_2_1,+ sub_task_2_2,+ sub_task_3,+ ]++ sorted_tasks = manager.topological_sort(new_tasks)+ sorted_tasks_ids = [task.id for task in sorted_tasks]+ print(sorted_tasks_ids)+ assert sorted_tasks_ids == ["1", "2.1", "2.2", "2", "3"]++ manager.add_tasks(new_tasks)+ print([task.id for task in manager.tasks])+ assert [task.id for task in manager.tasks] == [+ "1",+ "2.1",+ "2.2",+ "2",+ "3",+ "0",+ ]