🐫 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
Auto-update documentation after merge
camel-docs-botb6b140e309d5
diff --git a/docs/reference/camel.runtimes.configs.md b/docs/reference/camel.runtimes.configs.mdnew file mode 100644index 000000000..5c5a90740--- /dev/null+++ b/docs/reference/camel.runtimes.configs.md@@ -0,0 +1,32 @@+<a id="camel.runtimes.configs"></a>++<a id="camel.runtimes.configs.TaskConfig"></a>++## TaskConfig++```python+class TaskConfig(BaseModel):+```++A configuration for a task to run a command inside the container.++Arttributes:+cmd (str or list): Command to be executed+stdout (bool): Attach to stdout. (default: :obj:`True`)+stderr (bool): Attach to stderr. (default: :obj:`True`)+stdin (bool): Attach to stdin. (default: :obj:`False`)+tty (bool): Allocate a pseudo-TTY. (default: :obj:`False`)+privileged (bool): Run as privileged. (default: :obj:`False`)+user (str): User to execute command as. (default: :obj:`""`)+detach (bool): If true, detach from the exec command.+(default: :obj:`False`)+stream (bool): Stream response data. (default: :obj:`False`)+socket (bool): Return the connection socket to allow custom+read/write operations. (default: :obj:`False`)+environment (dict or list): A dictionary or a list of strings in+the following format `__INLINE_CODE_9__` or+`__INLINE_CODE_10____INLINE_CODE_11__None`)+workdir (str): Path to working directory for this exec session.+(default: :obj:`None`)+demux (bool): Return stdout and stderr separately. (default: :obj:+`False`)diff --git a/docs/reference/camel.runtimes.daytona_runtime.md b/docs/reference/camel.runtimes.daytona_runtime.mdnew file mode 100644index 000000000..3309b9a3d--- /dev/null+++ b/docs/reference/camel.runtimes.daytona_runtime.md@@ -0,0 +1,136 @@+<a id="camel.runtimes.daytona_runtime"></a>++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime"></a>++## DaytonaRuntime++```python+class DaytonaRuntime(BaseRuntime):+```++A runtime that executes functions in a Daytona sandbox environment.+Requires the Daytona server to be running and an API key configured.++**Parameters:**++- **api_key** (Optional[str]): The Daytona API key for authentication. If not provided, it will try to use the DAYTONA_API_KEY environment variable. (default: :obj:`None`)+- **api_url** (Optional[str]): The URL of the Daytona server. If not provided, it will try to use the DAYTONA_API_URL environment variable. If none is provided, it will use "http://localhost:8000". (default: :obj:`None`)+- **language** (Optional[str]): The programming language for the sandbox. (default: :obj:`"python"`)++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime.__init__"></a>++### __init__++```python+def __init__(+ self,+ api_key: Optional[str] = None,+ api_url: Optional[str] = None,+ language: Optional[str] = 'python'+):+```++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime.build"></a>++### build++```python+def build(self):+```++**Returns:**++ DaytonaRuntime: The current runtime.++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime._cleanup"></a>++### _cleanup++```python+def _cleanup(self):+```++Clean up the sandbox when exiting.++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime.add"></a>++### add++```python+def add(+ self,+ funcs: Union[FunctionTool, List[FunctionTool]],+ entrypoint: str,+ arguments: Optional[Dict[str, Any]] = None+):+```++Add a function or list of functions to the runtime.++**Parameters:**++- **funcs** (Union[FunctionTool, List[FunctionTool]]): The function or list of functions to add.+- **entrypoint** (str): The entrypoint for the function.+- **arguments** (Optional[Dict[str, Any]]): The arguments for the function. (default: :obj:`None`)++**Returns:**++ DaytonaRuntime: The current runtime.++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime.info"></a>++### info++```python+def info(self):+```++**Returns:**++ str: Information about the sandbox.++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime.__del__"></a>++### __del__++```python+def __del__(self):+```++Clean up the sandbox when the object is deleted.++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime.stop"></a>++### stop++```python+def stop(self):+```++**Returns:**++ DaytonaRuntime: The current runtime.++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime.reset"></a>++### reset++```python+def reset(self):+```++**Returns:**++ DaytonaRuntime: The current runtime.++<a id="camel.runtimes.daytona_runtime.DaytonaRuntime.docs"></a>++### docs++```python+def docs(self):+```++**Returns:**++ str: The URL for the API documentation.diff --git a/docs/reference/camel.runtimes.docker_runtime.md b/docs/reference/camel.runtimes.docker_runtime.mdnew file mode 100644index 000000000..85d58534f--- /dev/null+++ b/docs/reference/camel.runtimes.docker_runtime.md@@ -0,0 +1,261 @@+<a id="camel.runtimes.docker_runtime"></a>++<a id="camel.runtimes.docker_runtime.DockerRuntime"></a>++## DockerRuntime++```python+class DockerRuntime(BaseRuntime):+```++A class representing a runtime environment using Docker.+This class automatically wraps functions to be executed+in a Docker container.++**Parameters:**++- **image** (str): The name of the Docker image to use for the runtime.+- **port** (int): The port number to use for the runtime API. (default: :obj: `8000`)+- **remove** (bool): Whether to remove the container after stopping it. ' (default: :obj:`True`)+- **kwargs** (dict): Additional keyword arguments to pass to the Docker client.++<a id="camel.runtimes.docker_runtime.DockerRuntime.__init__"></a>++### __init__++```python+def __init__(+ self,+ image: str,+ port: int = 8000,+ remove: bool = True,+ **kwargs+):+```++<a id="camel.runtimes.docker_runtime.DockerRuntime.mount"></a>++### mount++```python+def mount(self, path: str, mount_path: str):+```++Mount a local directory to the container.++**Parameters:**++- **path** (str): The local path to mount.+- **mount_path** (str): The path to mount the local directory to in the container.++**Returns:**++ DockerRuntime: The DockerRuntime instance.++<a id="camel.runtimes.docker_runtime.DockerRuntime.copy"></a>++### copy++```python+def copy(self, source: str, dest: str):+```++Copy a file or directory to the container.++**Parameters:**++- **source** (str): The local path to the file.+- **dest** (str): The path to copy the file to in the container.++**Returns:**++ DockerRuntime: The DockerRuntime instance.++<a id="camel.runtimes.docker_runtime.DockerRuntime.add_task"></a>++### add_task++```python+def add_task(self, task: TaskConfig):+```++Add a task to run a command inside the container when building.+Similar to `docker exec`.++**Parameters:**++- **task** (TaskConfig): The configuration for the task.++**Returns:**++ DockerRuntime: The DockerRuntime instance.++<a id="camel.runtimes.docker_runtime.DockerRuntime.exec_run"></a>++### exec_run++```python+def exec_run(self, task: TaskConfig):+```++Run a command inside this container. Similar to `docker exec`.++**Parameters:**++- **task** (TaskConfig): The configuration for the task.++**Returns:**++ (ExecResult): A tuple of (exit_code, output)+exit_code: (int):+Exit code for the executed command or `None` if+either `stream` or `socket` is `True`.+output: (generator, bytes, or tuple):+If `stream=True`, a generator yielding response chunks.+If `socket=True`, a socket object for the connection.+If `demux=True`, a tuple of two bytes: stdout and stderr.+A bytestring containing response data otherwise.++<a id="camel.runtimes.docker_runtime.DockerRuntime.build"></a>++### build++```python+def build(self, time_out: int = 15):+```++Build the Docker container and start it.++**Parameters:**++- **time_out** (int): The number of seconds to wait for the container to start. (default: :obj:`15`)++**Returns:**++ DockerRuntime: The DockerRuntime instance.++<a id="camel.runtimes.docker_runtime.DockerRuntime.add"></a>++### add++```python+def add(+ self,+ funcs: Union[FunctionTool, List[FunctionTool]],+ entrypoint: str,+ redirect_stdout: bool = False,+ arguments: Optional[Dict[str, Any]] = None+):+```++Add a function or list of functions to the runtime.++**Parameters:**++- **funcs** (Union[FunctionTool, List[FunctionTool]]): The function or list of functions to add.+- **entrypoint** (str): The entrypoint for the function.+- **redirect_stdout** (bool): Whether to return the stdout of the function. (default: :obj:`False`)+- **arguments** (Optional[Dict[str, Any]]): The arguments for the function. (default: :obj:`None`)++**Returns:**++ DockerRuntime: The DockerRuntime instance.++<a id="camel.runtimes.docker_runtime.DockerRuntime.reset"></a>++### reset++```python+def reset(self):+```++**Returns:**++ DockerRuntime: The DockerRuntime instance.++<a id="camel.runtimes.docker_runtime.DockerRuntime.stop"></a>++### stop++```python+def stop(self, remove: Optional[bool] = None):+```++stop the Docker container.++**Parameters:**++- **remove** (Optional[bool]): Whether to remove the container after stopping it. (default: :obj:`None`)++**Returns:**++ DockerRuntime: The DockerRuntime instance.++<a id="camel.runtimes.docker_runtime.DockerRuntime.ok"></a>++### ok++```python+def ok(self):+```++**Returns:**++ bool: Whether the API Server is running.++<a id="camel.runtimes.docker_runtime.DockerRuntime.wait"></a>++### wait++```python+def wait(self, timeout: int = 10):+```++Wait for the API Server to be ready.++**Parameters:**++- **timeout** (int): The number of seconds to wait. (default: :obj:`10`) (default: 10)++**Returns:**++ bool: Whether the API Server is ready.++<a id="camel.runtimes.docker_runtime.DockerRuntime.__enter__"></a>++### __enter__++```python+def __enter__(self):+```++**Returns:**++ DockerRuntime: The DockerRuntime instance.++<a id="camel.runtimes.docker_runtime.DockerRuntime.__exit__"></a>++### __exit__++```python+def __exit__(+ self,+ exc_type,+ exc_val,+ exc_tb+):+```++Exit the context manager.++<a id="camel.runtimes.docker_runtime.DockerRuntime.docs"></a>++### docs++```python+def docs(self):+```++**Returns:**++ str: The URL for the API documentation.diff --git a/docs/reference/camel.runtimes.remote_http_runtime.md b/docs/reference/camel.runtimes.remote_http_runtime.mdnew file mode 100644index 000000000..91f19a909--- /dev/null+++ b/docs/reference/camel.runtimes.remote_http_runtime.md@@ -0,0 +1,156 @@+<a id="camel.runtimes.remote_http_runtime"></a>++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime"></a>++## RemoteHttpRuntime++```python+class RemoteHttpRuntime(BaseRuntime):+```++A runtime that runs functions in a remote HTTP server.+You need to run the API server in the remote server first.++**Parameters:**++- **host** (str): The host of the remote server.+- **port** (int): The port of the remote server. (default: :obj:`8000`) (default: 8000)+- **python_exec** (str): The python executable to run the API server. (default: :obj:`python3`)++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime.__init__"></a>++### __init__++```python+def __init__(+ self,+ host: str,+ port: int = 8000,+ python_exec: str = 'python3'+):+```++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime.build"></a>++### build++```python+def build(self):+```++**Returns:**++ RemoteHttpRuntime: The current runtime.++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime._cleanup"></a>++### _cleanup++```python+def _cleanup(self):+```++Clean up the API server when exiting.++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime.add"></a>++### add++```python+def add(+ self,+ funcs: Union[FunctionTool, List[FunctionTool]],+ entrypoint: str,+ redirect_stdout: bool = False,+ arguments: Optional[Dict[str, Any]] = None+):+```++Add a function or list of functions to the runtime.++**Parameters:**++- **funcs** (Union[FunctionTool, List[FunctionTool]]): The function or list of functions to add.+- **entrypoint** (str): The entrypoint for the function.+- **redirect_stdout** (bool): Whether to return the stdout of the function. (default: :obj:`False`)+- **arguments** (Optional[Dict[str, Any]]): The arguments for the function. (default: :obj:`None`)++**Returns:**++ RemoteHttpRuntime: The current runtime.++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime.ok"></a>++### ok++```python+def ok(self):+```++**Returns:**++ bool: Whether the API Server is running.++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime.wait"></a>++### wait++```python+def wait(self, timeout: int = 10):+```++Wait for the API Server to be ready.++**Parameters:**++- **timeout** (int): The number of seconds to wait. (default: :obj:`10`) (default: 10)++**Returns:**++ bool: Whether the API Server is ready.++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime.__del__"></a>++### __del__++```python+def __del__(self):+```++Clean up the API server when the object is deleted.++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime.stop"></a>++### stop++```python+def stop(self):+```++**Returns:**++ RemoteHttpRuntime: The current runtime.++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime.reset"></a>++### reset++```python+def reset(self):+```++**Returns:**++ RemoteHttpRuntime: The current runtime.++<a id="camel.runtimes.remote_http_runtime.RemoteHttpRuntime.docs"></a>++### docs++```python+def docs(self):+```++**Returns:**++ str: The URL for the API documentation.diff --git a/docs/reference/camel.societies.workforce.single_agent_worker.md b/docs/reference/camel.societies.workforce.single_agent_worker.mdindex 1dc83058b..2ebc1cd4f 100644--- a/docs/reference/camel.societies.workforce.single_agent_worker.md+++ b/docs/reference/camel.societies.workforce.single_agent_worker.md@@ -1,5 +1,73 @@<a id="camel.societies.workforce.single_agent_worker"></a>+<a id="camel.societies.workforce.single_agent_worker.AgentPool"></a>++## AgentPool++```python+class AgentPool:+```++A pool of agent instances for efficient reuse.++This pool manages a collection of pre-cloned agents. It supports+auto-scaling based ondemand and intelligent reuse of existing agents.++**Parameters:**++- **base_agent** (ChatAgent): The base agent to clone from.+- **initial_size** (int): Initial number of agents in the pool. (default: :obj:`1`)+- **max_size** (int): Maximum number of agents in the pool. (default: :obj:`10`)+- **auto_scale** (bool): Whether to automatically scale the pool size. (default: :obj:`True`)+- **scale_factor** (float): Factor by which to scale the pool when needed. (default: :obj:`1.5`)+- **idle_timeout** (float): Time in seconds after which idle agents are removed. (default: :obj:`180.0`)++<a id="camel.societies.workforce.single_agent_worker.AgentPool.__init__"></a>++### __init__++```python+def __init__(+ self,+ base_agent: ChatAgent,+ initial_size: int = 1,+ max_size: int = 10,+ auto_scale: bool = True,+ scale_factor: float = 1.5,+ idle_timeout: float = 180.0+):+```++<a id="camel.societies.workforce.single_agent_worker.AgentPool._initialize_pool"></a>++### _initialize_pool++```python+def _initialize_pool(self, size: int):+```++Initialize the pool with the specified number of agents.++<a id="camel.societies.workforce.single_agent_worker.AgentPool._create_fresh_agent"></a>++### _create_fresh_agent++```python+def _create_fresh_agent(self):+```++Create a fresh agent instance.++<a id="camel.societies.workforce.single_agent_worker.AgentPool.get_stats"></a>++### get_stats++```python+def get_stats(self):+```++Get pool statistics.+<a id="camel.societies.workforce.single_agent_worker.SingleAgentWorker"></a>## SingleAgentWorker@@ -14,7 +82,10 @@ A worker node that consists of a single agent.- **description** (str): Description of the node.- **worker** (ChatAgent): Worker of the node. A single agent.-- **max_concurrent_tasks** (int): Maximum number of tasks this worker can process concurrently. (default: :obj:`10`)+- **use_agent_pool** (bool): Whether to use agent pool for efficiency. (default: :obj:`True`)+- **pool_initial_size** (int): Initial size of the agent pool. (default: :obj:`1`)+- **pool_max_size** (int): Maximum size of the agent pool. (default: :obj:`10`)+- **auto_scale_pool** (bool): Whether to auto-scale the agent pool. (default: :obj:`True`)<a id="camel.societies.workforce.single_agent_worker.SingleAgentWorker.__init__"></a>@@ -25,7 +96,10 @@ def __init__(self,description: str,worker: ChatAgent,- max_concurrent_tasks: int = 10+ use_agent_pool: bool = True,+ pool_initial_size: int = 1,+ pool_max_size: int = 10,+ auto_scale_pool: bool = True):```@@ -38,3 +112,13 @@ def reset(self):```Resets the worker to its initial state.++<a id="camel.societies.workforce.single_agent_worker.SingleAgentWorker.get_pool_stats"></a>++### get_pool_stats++```python+def get_pool_stats(self):+```++Get agent pool statistics if pool is enabled.diff --git a/docs/reference/camel.societies.workforce.worker.md b/docs/reference/camel.societies.workforce.worker.mdindex 1db57550e..ce7498fdb 100644--- a/docs/reference/camel.societies.workforce.worker.md+++ b/docs/reference/camel.societies.workforce.worker.md@@ -15,19 +15,13 @@ processing in the workforce system.- **description** (str): Description of the node.- **node_id** (Optional[str]): ID of the node. If not provided, it will be generated automatically. (default: :obj:`None`)-- **max_concurrent_tasks** (int): Maximum number of tasks this worker can process concurrently. (default: :obj:`10`)<a id="camel.societies.workforce.worker.Worker.__init__"></a>### __init__```python-def __init__(- self,- description: str,- node_id: Optional[str] = None,- max_concurrent_tasks: int = 10-):+def __init__(self, description: str, node_id: Optional[str] = None):```<a id="camel.societies.workforce.worker.Worker.__repr__"></a>diff --git a/docs/reference/camel.societies.workforce.workforce.md b/docs/reference/camel.societies.workforce.workforce.mdindex 46c0f3a6c..03689a2e2 100644--- a/docs/reference/camel.societies.workforce.workforce.md+++ b/docs/reference/camel.societies.workforce.workforce.md@@ -358,7 +358,7 @@ def add_single_agent_worker(self,description: str,worker: ChatAgent,- max_concurrent_tasks: int = 10+ pool_max_size: int = 10):```@@ -368,7 +368,7 @@ Add a worker node to the workforce that uses a single agent.- **description** (str): Description of the worker node.- **worker** (ChatAgent): The agent to be added.-- **max_concurrent_tasks** (int): Maximum number of tasks this worker can process concurrently. (default: :obj:`10`)+- **pool_max_size** (int): Maximum size of the agent pool. (default: :obj:`10`)**Returns:**diff --git a/docs/reference/camel.tasks.task.md b/docs/reference/camel.tasks.task.mdnew file mode 100644index 000000000..5e9ae310a--- /dev/null+++ b/docs/reference/camel.tasks.task.md@@ -0,0 +1,433 @@+<a id="camel.tasks.task"></a>++<a id="camel.tasks.task.validate_task_content"></a>++## validate_task_content++```python+def validate_task_content(content: str, task_id: str = 'unknown', min_length: int = 10):+```++Validates task result content to avoid silent failures.+It performs basic checks to ensure the content meets minimum+quality standards.++**Parameters:**++- **content** (str): The task result content to validate.+- **task_id** (str): Task ID for logging purposes. (default: :obj:`"unknown"`)+- **min_length** (int): Minimum content length after stripping whitespace. (default: :obj:`10`)++**Returns:**++ bool: True if content passes validation, False otherwise.++<a id="camel.tasks.task.parse_response"></a>++## parse_response++```python+def parse_response(response: str, task_id: Optional[str] = None):+```++Parse Tasks from a response.++**Parameters:**++- **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.++<a id="camel.tasks.task.TaskState"></a>++## TaskState++```python+class TaskState(str, Enum):+```++<a id="camel.tasks.task.TaskState.states"></a>++### states++```python+def states(cls):+```++<a id="camel.tasks.task.Task"></a>++## Task++```python+class Task(BaseModel):+```++Task is specific assignment that can be passed to a agent.++**Parameters:**++- **content** (str): string content for task.+- **id** (str): An unique string identifier for the task. This should ideally be provided by the provider/model which created the task. (default: :obj:`uuid.uuid4()`)+- **state** (TaskState): The state which should be OPEN, RUNNING, DONE or DELETED. (default: :obj:`TaskState.FAILED`)+- **type** (Optional[str]): task type. (default: :obj:`None`)+- **parent** (Optional[Task]): The parent task, None for root task. (default: :obj:`None`)+- **subtasks** (List[Task]): The childrent sub-tasks for the task. (default: :obj:`[]`)+- **result** (Optional[str]): The answer for the task. (default: :obj:`""`)+- **failure_count** (int): The failure count for the task. (default: :obj:`0`)+- **additional_info** (Optional[Dict[str, Any]]): Additional information for the task. (default: :obj:`None`)++<a id="camel.tasks.task.Task.__repr__"></a>++### __repr__++```python+def __repr__(self):+```++Return a string representation of the task.++<a id="camel.tasks.task.Task.from_message"></a>++### from_message++```python+def from_message(cls, message: BaseMessage):+```++Create a task from a message.++**Parameters:**++- **message** (BaseMessage): The message to the task.++**Returns:**++ Task++<a id="camel.tasks.task.Task.to_message"></a>++### to_message++```python+def to_message():+```++Convert a Task to a Message.++<a id="camel.tasks.task.Task.reset"></a>++### reset++```python+def reset(self):+```++Reset Task to initial state.++<a id="camel.tasks.task.Task.update_result"></a>++### update_result++```python+def update_result(self, result: str):+```++Set task result and mark the task as DONE.++**Parameters:**++- **result** (str): The task result.++<a id="camel.tasks.task.Task.set_id"></a>++### set_id++```python+def set_id(self, id: str):+```++Set the id of the task.++**Parameters:**++- **id** (str): The id of the task.++<a id="camel.tasks.task.Task.set_state"></a>++### set_state++```python+def set_state(self, state: TaskState):+```++Recursively set the state of the task and its subtasks.++**Parameters:**++- **state** (TaskState): The giving state.++<a id="camel.tasks.task.Task.add_subtask"></a>++### add_subtask++```python+def add_subtask(self, task: 'Task'):+```++Add a subtask to the current task.++**Parameters:**++- **task** (Task): The subtask to be added.++<a id="camel.tasks.task.Task.remove_subtask"></a>++### remove_subtask++```python+def remove_subtask(self, id: str):+```++Remove a subtask from the current task.++**Parameters:**++- **id** (str): The id of the subtask to be removed.++<a id="camel.tasks.task.Task.get_running_task"></a>++### get_running_task++```python+def get_running_task(self):+```++Get RUNNING task.++<a id="camel.tasks.task.Task.to_string"></a>++### to_string++```python+def to_string(self, indent: str = '', state: bool = False):+```++Convert task to a string.++**Parameters:**++- **indent** (str): The ident for hierarchical tasks.+- **state** (bool): Include or not task state.++**Returns:**++ str: The printable task string.++<a id="camel.tasks.task.Task.get_result"></a>++### get_result++```python+def get_result(self, indent: str = ''):+```++Get task result to a string.++**Parameters:**++- **indent** (str): The ident for hierarchical tasks.++**Returns:**++ str: The printable task string.++<a id="camel.tasks.task.Task.decompose"></a>++### decompose++```python+def decompose(+ self,+ agent: 'ChatAgent',+ prompt: Optional[str] = None,+ task_parser: Callable[[str, str], List['Task']] = parse_response+):+```++Decompose a task to a list of sub-tasks. It can be used for data+generation and planner of agent.++**Parameters:**++- **agent** (ChatAgent): An agent that used to decompose the task.+- **prompt** (str, optional): A prompt to decompose the task. If not provided, the default prompt 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` instances.++<a id="camel.tasks.task.Task.compose"></a>++### compose++```python+def compose(+ self,+ agent: 'ChatAgent',+ template: TextPrompt = TASK_COMPOSE_PROMPT,+ result_parser: Optional[Callable[[str], str]] = None+):+```++compose task result by the sub-tasks.++**Parameters:**++- **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.++<a id="camel.tasks.task.Task.get_depth"></a>++### get_depth++```python+def get_depth(self):+```++Get current task depth.++<a id="camel.tasks.task.TaskManager"></a>++## TaskManager++```python+class TaskManager:+```++TaskManager is used to manage tasks.++**Parameters:**++- **task** (Task): The root Task.++<a id="camel.tasks.task.TaskManager.__init__"></a>++### __init__++```python+def __init__(self, task: Task):+```++<a id="camel.tasks.task.TaskManager.gen_task_id"></a>++### gen_task_id++```python+def gen_task_id(self):+```++Generate a new task id.++<a id="camel.tasks.task.TaskManager.exist"></a>++### exist++```python+def exist(self, task_id: str):+```++Check if a task with the given id exists.++<a id="camel.tasks.task.TaskManager.current_task"></a>++### current_task++```python+def current_task(self):+```++Get the current task.++<a id="camel.tasks.task.TaskManager.topological_sort"></a>++### topological_sort++```python+def topological_sort(tasks: List[Task]):+```++Sort a list of tasks by topological way.++**Parameters:**++- **tasks** (List[Task]): The giving list of tasks.++**Returns:**++ The sorted list of tasks.++<a id="camel.tasks.task.TaskManager.set_tasks_dependence"></a>++### set_tasks_dependence++```python+def set_tasks_dependence(+ root: Task,+ others: List[Task],+ type: Literal['serial', 'parallel'] = 'parallel'+):+```++Set relationship between root task and other tasks.+Two relationships are currently supported: serial and parallel.+`serial` : root -> other1 -> other2+`parallel`: root -> other1+-> other2++**Parameters:**++- **root** (Task): A root task.+- **others** (List[Task]): A list of tasks.++<a id="camel.tasks.task.TaskManager.add_tasks"></a>++### add_tasks++```python+def add_tasks(self, tasks: Union[Task, List[Task]]):+```++self.tasks and self.task_map will be updated by the input tasks.++<a id="camel.tasks.task.TaskManager.evolve"></a>++### evolve++```python+def evolve(+ self,+ task: Task,+ agent: 'ChatAgent',+ template: Optional[TextPrompt] = None,+ task_parser: Optional[Callable[[str, str], List[Task]]] = None+):+```++Evolve a task to a new task.+Evolve is only used for data generation.++**Parameters:**++- **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.diff --git a/docs/reference/camel.toolkits.aci_toolkit.md b/docs/reference/camel.toolkits.aci_toolkit.mdnew file mode 100644index 000000000..522f19577--- /dev/null+++ b/docs/reference/camel.toolkits.aci_toolkit.md@@ -0,0 +1,346 @@+<a id="camel.toolkits.aci_toolkit"></a>++<a id="camel.toolkits.aci_toolkit.ACIToolkit"></a>++## ACIToolkit++```python+class ACIToolkit(BaseToolkit):+```++A toolkit for interacting with the ACI API.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.__init__"></a>++### __init__++```python+def __init__(+ self,+ api_key: Optional[str] = None,+ base_url: Optional[str] = None,+ linked_account_owner_id: Optional[str] = None,+ timeout: Optional[float] = None+):+```++Initialize the ACI toolkit.++**Parameters:**++- **api_key** (Optional[str]): The API key for authentication. (default: :obj:`None`)+- **base_url** (Optional[str]): The base URL for the ACI API. (default: :obj:`None`)+- **linked_account_owner_id** (Optional[str]): ID of the owner of the linked account, e.g., "johndoe" (default: :obj:`None`)+- **timeout** (Optional[float]): Request timeout. (default: :obj:`None`)++<a id="camel.toolkits.aci_toolkit.ACIToolkit.search_tool"></a>++### search_tool++```python+def search_tool(+ self,+ intent: Optional[str] = None,+ allowed_app_only: bool = True,+ include_functions: bool = False,+ categories: Optional[List[str]] = None,+ limit: Optional[int] = 10,+ offset: Optional[int] = 0+):+```++Search for apps based on intent.++**Parameters:**++- **intent** (Optional[str]): Search results will be sorted by relevance to this intent. (default: :obj:`None`)+- **allowed_app_only** (bool): If true, only return apps that are allowed by the agent/accessor, identified by the api key. (default: :obj:`True`)+- **include_functions** (bool): If true, include functions (name and description) in the search results. (default: :obj:`False`)+- **categories** (Optional[List[str]]): List of categories to filter the search results. Defaults to an empty list. (default: :obj:`None`)+- **limit** (Optional[int]): Maximum number of results to return. (default: :obj:`10`)+- **offset** (Optional[int]): Offset for pagination. (default: :obj:`0`)++**Returns:**++ Optional[List[AppBasic]]: List of matching apps if successful,+error message otherwise.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.list_configured_apps"></a>++### list_configured_apps++```python+def list_configured_apps(+ self,+ app_names: Optional[List[str]] = None,+ limit: Optional[int] = 10,+ offset: Optional[int] = 0+):+```++List all configured apps.++**Parameters:**++- **app_names** (Optional[List[str]]): List of app names to filter the results. (default: :obj:`None`)+- **limit** (Optional[int]): Maximum number of results to return. (default: :obj:`10`)+- **offset** (Optional[int]): Offset for pagination. (default: :obj:`0`) (default: 0)++**Returns:**++ Union[List[AppConfiguration], str]: List of configured apps if+successful, error message otherwise.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.configure_app"></a>++### configure_app++```python+def configure_app(self, app_name: str):+```++Configure an app with specified authentication type.++**Parameters:**++- **app_name** (str): Name of the app to configure.++**Returns:**++ Union[Dict, str]: Configuration result or error message.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.get_app_configuration"></a>++### get_app_configuration++```python+def get_app_configuration(self, app_name: str):+```++Get app configuration by app name.++**Parameters:**++- **app_name** (str): Name of the app to get configuration for.++**Returns:**++ Union[AppConfiguration, str]: App configuration if successful,+error message otherwise.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.delete_app"></a>++### delete_app++```python+def delete_app(self, app_name: str):+```++Delete an app configuration.++**Parameters:**++- **app_name** (str): Name of the app to delete.++**Returns:**++ Optional[str]: None if successful, error message otherwise.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.link_account"></a>++### link_account++```python+def link_account(self, app_name: str):+```++Link an account to a configured app.++**Parameters:**++- **app_name** (str): Name of the app to link the account to.++**Returns:**++ Union[LinkedAccount, str]: LinkedAccount object if successful,+error message otherwise.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.get_app_details"></a>++### get_app_details++```python+def get_app_details(self, app_name: str):+```++Get details of an app.++**Parameters:**++- **app_name** (str): Name of the app to get details for.++**Returns:**++ AppDetails: App details.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.get_linked_accounts"></a>++### get_linked_accounts++```python+def get_linked_accounts(self, app_name: str):+```++List all linked accounts for a specific app.++**Parameters:**++- **app_name** (str): Name of the app to get linked accounts for.++**Returns:**++ Union[List[LinkedAccount], str]: List of linked accounts if+successful, error message otherwise.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.enable_linked_account"></a>++### enable_linked_account++```python+def enable_linked_account(self, linked_account_id: str):+```++Enable a linked account.++**Parameters:**++- **linked_account_id** (str): ID of the linked account to enable.++**Returns:**++ Union[LinkedAccount, str]: Linked account if successful, error+message otherwise.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.disable_linked_account"></a>++### disable_linked_account++```python+def disable_linked_account(self, linked_account_id: str):+```++Disable a linked account.++**Parameters:**++- **linked_account_id** (str): ID of the linked account to disable.++**Returns:**++ Union[LinkedAccount, str]: The updated linked account if+successful, error message otherwise.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.delete_linked_account"></a>++### delete_linked_account++```python+def delete_linked_account(self, linked_account_id: str):+```++Delete a linked account.++**Parameters:**++- **linked_account_id** (str): ID of the linked account to delete.++**Returns:**++ str: Success message if successful, error message otherwise.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.function_definition"></a>++### function_definition++```python+def function_definition(self, func_name: str):+```++Get the function definition for an app.++**Parameters:**++- **app_name** (str): Name of the app to get function definition for++**Returns:**++ Dict: Function definition dictionary.++<a id="camel.toolkits.aci_toolkit.ACIToolkit.search_function"></a>++### search_function++```python+def search_function(+ self,+ app_names: Optional[List[str]] = None,+ intent: Optional[str] = None,+ allowed_apps_only: bool = True,+ limit: Optional[int] = 10,+ offset: Optional[int] = 0+):+```++Search for functions based on intent.++**Parameters:**++- **app_names** (Optional[List[str]]): List of app names to filter the search results. (default: :obj:`None`)+- **intent** (Optional[str]): The search query/intent. (default: :obj:`None`)+- **allowed_apps_only** (bool): If true, only return functions from allowed apps. (default: :obj:`True`)+- **limit** (Optional[int]): Maximum number of results to return. (default: :obj:`10`)+- **offset** (Optional[int]): Offset for pagination. (default: :obj:`0`)++**Returns:**++ List[Dict]: List of matching functions++<a id="camel.toolkits.aci_toolkit.ACIToolkit.execute_function"></a>++### execute_function++```python+def execute_function(+ self,+ function_name: str,+ function_arguments: Dict,+ linked_account_owner_id: str,+ allowed_apps_only: bool = False+):+```++Execute a function call.++**Parameters:**++- **function_name** (str): Name of the function to execute.+- **function_arguments** (Dict): Arguments to pass to the function.+- **linked_account_owner_id** (str): To specify the end-user (account owner) on behalf of whom you want to execute functions You need to first link corresponding account with the same owner id in the ACI dashboard (https://platform.aci.dev).+- **allowed_apps_only** (bool): If true, only returns functions/apps that are allowed to be used by the agent/accessor, identified by the api key. (default: :obj:`False`)++**Returns:**++ Dict: Result of the function execution++<a id="camel.toolkits.aci_toolkit.ACIToolkit.get_tools"></a>++### get_tools++```python+def get_tools(self):+```++**Returns:**++ List[FunctionTool]: List of FunctionTool objects representing+available functionsdiff --git a/docs/reference/camel.toolkits.arxiv_toolkit.md b/docs/reference/camel.toolkits.arxiv_toolkit.mdnew file mode 100644index 000000000..0e46819e1--- /dev/null+++ b/docs/reference/camel.toolkits.arxiv_toolkit.md@@ -0,0 +1,119 @@+<a id="camel.toolkits.arxiv_toolkit"></a>++<a id="camel.toolkits.arxiv_toolkit.ArxivToolkit"></a>++## ArxivToolkit++```python+class ArxivToolkit(BaseToolkit):+```++A toolkit for interacting with the arXiv API to search and download+academic papers.++<a id="camel.toolkits.arxiv_toolkit.ArxivToolkit.__init__"></a>++### __init__++```python+def __init__(self, timeout: Optional[float] = None):+```++Initializes the ArxivToolkit and sets up the arXiv client.++<a id="camel.toolkits.arxiv_toolkit.ArxivToolkit._get_search_results"></a>++### _get_search_results++```python+def _get_search_results(+ self,+ query: str,+ paper_ids: Optional[List[str]] = None,+ max_results: Optional[int] = 5+):+```++Retrieves search results from the arXiv API based on the provided+query and optional paper IDs.++**Parameters:**++- **query** (str): The search query string used to search for papers on arXiv.+- **paper_ids** (List[str], optional): A list of specific arXiv paper IDs to search for. (default: :obj:`None`)+- **max_results** (int, optional): The maximum number of search results to retrieve. (default: :obj:`5`)++**Returns:**++ Generator: A generator that yields results from the arXiv search+query, which includes metadata about each paper matching the+query.++<a id="camel.toolkits.arxiv_toolkit.ArxivToolkit.search_papers"></a>++### search_papers++```python+def search_papers(+ self,+ query: str,+ paper_ids: Optional[List[str]] = None,+ max_results: Optional[int] = 5+):+```++Searches for academic papers on arXiv using a query string and+optional paper IDs.++**Parameters:**++- **query** (str): The search query string.+- **paper_ids** (List[str], optional): A list of specific arXiv paper IDs to search for. (default: :obj:`None`)+- **max_results** (int, optional): The maximum number of search results to return. (default: :obj:`5`)++**Returns:**++ List[Dict[str, str]]: A list of dictionaries, each containing+information about a paper, including title, published date,+authors, entry ID, summary, and extracted text from the paper.++<a id="camel.toolkits.arxiv_toolkit.ArxivToolkit.download_papers"></a>++### download_papers++```python+def download_papers(+ self,+ query: str,+ paper_ids: Optional[List[str]] = None,+ max_results: Optional[int] = 5,+ output_dir: Optional[str] = './'+):+```++Downloads PDFs of academic papers from arXiv based on the provided+query.++**Parameters:**++- **query** (str): The search query string.+- **paper_ids** (List[str], optional): A list of specific arXiv paper IDs to download. (default: :obj:`None`)+- **max_results** (int, optional): The maximum number of search results to download. (default: :obj:`5`)+- **output_dir** (str, optional): The directory to save the downloaded PDFs. Defaults to the current directory.++**Returns:**++ str: Status message indicating success or failure.++<a id="camel.toolkits.arxiv_toolkit.ArxivToolkit.get_tools"></a>++### get_tools++```python+def get_tools(self):+```++**Returns:**++ List[FunctionTool]: A list of FunctionTool objects+representing the functions in the toolkit.diff --git a/docs/reference/camel.toolkits.dappier_toolkit.md b/docs/reference/camel.toolkits.dappier_toolkit.mdnew file mode 100644index 000000000..681f33484--- /dev/null+++ b/docs/reference/camel.toolkits.dappier_toolkit.md@@ -0,0 +1,133 @@+<a id="camel.toolkits.dappier_toolkit"></a>++<a id="camel.toolkits.dappier_toolkit.DappierToolkit"></a>++## DappierToolkit++```python+class DappierToolkit(BaseToolkit):+```++A class representing a toolkit for interacting with the Dappier API.++This class provides methods for searching real time data and fetching+ai recommendations across key verticals like News, Finance, Stock Market,+Sports, Weather and more.++<a id="camel.toolkits.dappier_toolkit.DappierToolkit.__init__"></a>++### __init__++```python+def __init__(self, timeout: Optional[float] = None):+```++Initialize the DappierTookit with API clients.The API keys and+credentials are retrieved from environment variables.++<a id="camel.toolkits.dappier_toolkit.DappierToolkit.search_real_time_data"></a>++### search_real_time_data++```python+def search_real_time_data(+ self,+ query: str,+ ai_model_id: str = 'am_01j06ytn18ejftedz6dyhz2b15'+):+```++Search real-time data using an AI model.++This function accesses real-time information using the specified+AI model based on the given query. Depending on the AI model ID,+the data retrieved can vary between general web search results or+financial news and stock prices.++Supported AI Models:+- `am_01j06ytn18ejftedz6dyhz2b15`:+Access real-time Google web search results, including the latest+news, weather updates, travel details, deals, and more.+- `am_01j749h8pbf7ns8r1bq9s2evrh`:+Access real-time financial news, stock prices, and trades from+polygon.io, with AI-powered insights and up-to-the-minute updates.++**Parameters:**++- **query** (str): The user-provided query. Examples include: - "How is the weather today in Austin, TX?" - "What is the latest news for Meta?" - "What is the stock price for AAPL?"+- **ai_model_id** (str, optional): The AI model ID to use for the query. The AI model ID always starts with the prefix "am_". (default: `am_01j06ytn18ejftedz6dyhz2b15`)++**Returns:**++ str: The search result corresponding to the provided query and+AI model ID. This may include real time search data,+depending on the selected AI model.++**Note:**++Multiple AI model IDs are available, which can be found at:+https://marketplace.dappier.com/marketplace++<a id="camel.toolkits.dappier_toolkit.DappierToolkit.get_ai_recommendations"></a>++### get_ai_recommendations++```python+def get_ai_recommendations(+ self,+ query: str,+ data_model_id: str = 'dm_01j0pb465keqmatq9k83dthx34',+ similarity_top_k: int = 9,+ ref: Optional[str] = None,+ num_articles_ref: int = 0,+ search_algorithm: Literal['most_recent', 'semantic', 'most_recent_semantic', 'trending'] = 'most_recent'+):+```++Retrieve AI-powered recommendations based on the provided query+and data model.++This function fetches real-time AI-generated recommendations using the+specified data model and search algorithm. The results include+personalized content based on the query and, optionally, relevance+to a specific reference domain.++Supported Data Models:+- `dm_01j0pb465keqmatq9k83dthx34`:+Real-time news, updates, and personalized content from top sports+sources such as Sportsnaut, Forever Blueshirts, Minnesota Sports+Fan, LAFB Network, Bounding Into Sports, and Ringside Intel.+- `dm_01j0q82s4bfjmsqkhs3ywm3x6y`:+Real-time updates, analysis, and personalized content from top+sources like The Mix, Snipdaily, Nerdable, and Familyproof.++**Parameters:**++- **query** (str): The user query for retrieving recommendations.+- **data_model_id** (str, optional): The data model ID to use for recommendations. Data model IDs always start with the prefix "dm_". (default: :obj:`dm_01j0pb465keqmatq9k83dthx34`)+- **similarity_top_k** (int, optional): The number of top documents to retrieve based on similarity. (default: :obj:`9`)+- **ref** (Optional[str], optional): The site domain where AI recommendations should be displayed. (default: :obj:`None`)+- **num_articles_ref** (int, optional): The minimum number of articles to return from the specified reference domain (`ref`). The remaining articles will come from other sites in the RAG model. (default: :obj:`0`) search_algorithm (Literal[ "most_recent", "semantic", "most_recent_semantic", "trending", ], optional): The search algorithm to use for retrieving articles. (default: :obj:`most_recent`)++**Returns:**++ List[Dict[str, str]]: A list of recommended articles or content+based on the specified parameters, query, and data model.++**Note:**++Multiple data model IDs are available and can be found at:+https://marketplace.dappier.com/marketplace++<a id="camel.toolkits.dappier_toolkit.DappierToolkit.get_tools"></a>++### get_tools++```python+def get_tools(self):+```++**Returns:**++ List[FunctionTool]: A list of FunctionTool objects representing+the functions in the toolkit.diff --git a/docs/reference/camel.toolkits.file_write_toolkit.md b/docs/reference/camel.toolkits.file_write_toolkit.mdnew file mode 100644index 000000000..e67194c41--- /dev/null+++ b/docs/reference/camel.toolkits.file_write_toolkit.md@@ -0,0 +1,304 @@+<a id="camel.toolkits.file_write_toolkit"></a>++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit"></a>++## FileWriteToolkit++```python+class FileWriteToolkit(BaseToolkit):+```++A toolkit for creating, writing, and modifying text in files.++This class provides cross-platform (macOS, Linux, Windows) support for+writing to various file formats (Markdown, DOCX, PDF, and plaintext),+replacing text in existing files, automatic backups, custom encoding,+and enhanced formatting options for specialized formats.++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit.__init__"></a>++### __init__++```python+def __init__(+ self,+ output_dir: str = './',+ timeout: Optional[float] = None,+ default_encoding: str = 'utf-8',+ backup_enabled: bool = True+):+```++Initialize the FileWriteToolkit.++**Parameters:**++- **output_dir** (str): The default directory for output files. Defaults to the current working directory.+- **timeout** (Optional[float]): The timeout for the toolkit. (default: :obj:`None`)+- **default_encoding** (str): Default character encoding for text operations. (default: :obj:`utf-8`)+- **backup_enabled** (bool): Whether to create backups of existing files before overwriting. (default: :obj:`True`)++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._resolve_filepath"></a>++### _resolve_filepath++```python+def _resolve_filepath(self, file_path: str):+```++Convert the given string path to a Path object.++If the provided path is not absolute, it is made relative to the+default output directory. The filename part is sanitized to replace+spaces and special characters with underscores, ensuring safe usage+in downstream processing.++**Parameters:**++- **file_path** (str): The file path to resolve.++**Returns:**++ Path: A fully resolved (absolute) and sanitized Path object.++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._write_text_file"></a>++### _write_text_file++```python+def _write_text_file(+ self,+ file_path: Path,+ content: str,+ encoding: str = 'utf-8'+):+```++Write text content to a plaintext file.++**Parameters:**++- **file_path** (Path): The target file path.+- **content** (str): The text content to write.+- **encoding** (str): Character encoding to use. (default: :obj:`utf-8`) (default: utf-8)++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._create_backup"></a>++### _create_backup++```python+def _create_backup(self, file_path: Path):+```++Create a backup of the file if it exists and backup is enabled.++**Parameters:**++- **file_path** (Path): Path to the file to backup.++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._write_docx_file"></a>++### _write_docx_file++```python+def _write_docx_file(self, file_path: Path, content: str):+```++Write text content to a DOCX file with default formatting.++**Parameters:**++- **file_path** (Path): The target file path.+- **content** (str): The text content to write.++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._write_pdf_file"></a>++### _write_pdf_file++```python+def _write_pdf_file(+ self,+ file_path: Path,+ content: str,+ use_latex: bool = False+):+```++Write text content to a PDF file with default formatting.++**Parameters:**++- **file_path** (Path): The target file path.+- **content** (str): The text content to write.+- **use_latex** (bool): Whether to use LaTeX for rendering. (requires LaTeX toolchain). If False, uses FPDF for simpler PDF generation. (default: :obj:`False`)++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._write_csv_file"></a>++### _write_csv_file++```python+def _write_csv_file(+ self,+ file_path: Path,+ content: Union[str, List[List]],+ encoding: str = 'utf-8'+):+```++Write CSV content to a file.++**Parameters:**++- **file_path** (Path): The target file path.+- **content** (Union[str, List[List]]): The CSV content as a string or list of lists.+- **encoding** (str): Character encoding to use. (default: :obj:`utf-8`) (default: utf-8)++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._write_json_file"></a>++### _write_json_file++```python+def _write_json_file(+ self,+ file_path: Path,+ content: str,+ encoding: str = 'utf-8'+):+```++Write JSON content to a file.++**Parameters:**++- **file_path** (Path): The target file path.+- **content** (str): The JSON content as a string.+- **encoding** (str): Character encoding to use. (default: :obj:`utf-8`) (default: utf-8)++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._write_yaml_file"></a>++### _write_yaml_file++```python+def _write_yaml_file(+ self,+ file_path: Path,+ content: str,+ encoding: str = 'utf-8'+):+```++Write YAML content to a file.++**Parameters:**++- **file_path** (Path): The target file path.+- **content** (str): The YAML content as a string.+- **encoding** (str): Character encoding to use. (default: :obj:`utf-8`) (default: utf-8)++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._write_html_file"></a>++### _write_html_file++```python+def _write_html_file(+ self,+ file_path: Path,+ content: str,+ encoding: str = 'utf-8'+):+```++Write text content to an HTML file.++**Parameters:**++- **file_path** (Path): The target file path.+- **content** (str): The HTML content to write.+- **encoding** (str): Character encoding to use. (default: :obj:`utf-8`) (default: utf-8)++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._write_markdown_file"></a>++### _write_markdown_file++```python+def _write_markdown_file(+ self,+ file_path: Path,+ content: str,+ encoding: str = 'utf-8'+):+```++Write text content to a Markdown file.++**Parameters:**++- **file_path** (Path): The target file path.+- **content** (str): The Markdown content to write.+- **encoding** (str): Character encoding to use. (default: :obj:`utf-8`) (default: utf-8)++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit.write_to_file"></a>++### write_to_file++```python+def write_to_file(+ self,+ content: Union[str, List[List[str]]],+ filename: str,+ encoding: Optional[str] = None,+ use_latex: bool = False+):+```++Write the given content to a file.++If the file exists, it will be overwritten. Supports multiple formats:+Markdown (.md, .markdown, default), Plaintext (.txt), CSV (.csv),+DOC/DOCX (.doc, .docx), PDF (.pdf), JSON (.json), YAML (.yml, .yaml),+and HTML (.html, .htm).++**Parameters:**++- **content** (Union[str, List[List[str]]]): The content to write to the file. Content format varies by file type: - Text formats (txt, md, html, yaml): string - CSV: string or list of lists - JSON: string or serializable object+- **filename** (str): The name or path of the file. If a relative path is supplied, it is resolved to self.output_dir.+- **encoding** (Optional[str]): The character encoding to use. (default: :obj: `None`)+- **use_latex** (bool): For PDF files, whether to use LaTeX rendering (True) or simple FPDF rendering (False). (default: :obj: `False`)++**Returns:**++ str: A message indicating success or error details.++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit.get_tools"></a>++### get_tools++```python+def get_tools(self):+```++**Returns:**++ List[FunctionTool]: A list of FunctionTool objects representing+the available functions in this toolkit.++<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._sanitize_filename"></a>++### _sanitize_filename++```python+def _sanitize_filename(self, filename: str):+```++Sanitize a filename by replacing any character that is not+alphanumeric, a dot (.), hyphen (-), or underscore (_) with an+underscore (_).++**Parameters:**++- **filename** (str): The original filename which may contain spaces or special characters.++**Returns:**++ str: The sanitized filename with disallowed characters replaced by+underscores.diff --git a/docs/reference/camel.toolkits.github_toolkit.md b/docs/reference/camel.toolkits.github_toolkit.mdnew file mode 100644index 000000000..3dce0c210--- /dev/null+++ b/docs/reference/camel.toolkits.github_toolkit.md@@ -0,0 +1,246 @@+<a id="camel.toolkits.github_toolkit"></a>++<a id="camel.toolkits.github_toolkit.GithubToolkit"></a>++## GithubToolkit++```python+class GithubToolkit(BaseToolkit):+```++A class representing a toolkit for interacting with GitHub+repositories.++This class provides methods for retrieving open issues, retrieving+specific issues, and creating pull requests in a GitHub repository.++**Parameters:**++- **access_token** (str, optional): The access token to authenticate with GitHub. If not provided, it will be obtained using the `get_github_access_token` method.++<a id="camel.toolkits.github_toolkit.GithubToolkit.__init__"></a>++### __init__++```python+def __init__(+ self,+ access_token: Optional[str] = None,+ timeout: Optional[float] = None+):+```++Initializes a new instance of the GitHubToolkit class.++**Parameters:**++- **repo_name** (str): The name of the GitHub repository.+- **access_token** (str, optional): The access token to authenticate with GitHub. If not provided, it will be obtained using the `get_github_access_token` method.++<a id="camel.toolkits.github_toolkit.GithubToolkit.get_github_access_token"></a>++### get_github_access_token++```python+def get_github_access_token(self):+```++**Returns:**++ str: A string containing the GitHub access token.++<a id="camel.toolkits.github_toolkit.GithubToolkit.create_pull_request"></a>++### create_pull_request++```python+def create_pull_request(+ self,+ repo_name: str,+ file_path: str,+ new_content: str,+ pr_title: str,+ body: str,+ branch_name: str+):+```++Creates a pull request.++This function creates a pull request in specified repository, which+updates a file in the specific path with new content. The pull request+description contains information about the issue title and number.++**Parameters:**++- **repo_name** (str): The name of the GitHub repository.+- **file_path** (str): The path of the file to be updated in the repository.+- **new_content** (str): The specified new content of the specified file.+- **pr_title** (str): The title of the issue that is solved by this pull request.+- **body** (str): The commit message for the pull request.+- **branch_name** (str): The name of the branch to create and submit the pull request from.++**Returns:**++ str: A formatted report of whether the pull request was created+successfully or not.++<a id="camel.toolkits.github_toolkit.GithubToolkit.get_issue_list"></a>++### get_issue_list++```python+def get_issue_list(+ self,+ repo_name: str,+ state: Literal['open', 'closed', 'all'] = 'all'+):+```++Retrieves all issues from the GitHub repository.++**Parameters:**++- **repo_name** (str): The name of the GitHub repository.+- **state** (`Literal["open", "closed", "all"]`): The state of pull requests to retrieve. (default: :obj:`all`) Options are: - "open": Retrieve only open pull requests. - "closed": Retrieve only closed pull requests. - "all": Retrieve all pull requests, regardless of state.++**Returns:**++ List[Dict[str, object]]: A list of dictionaries where each+dictionary contains the issue number and title.++<a id="camel.toolkits.github_toolkit.GithubToolkit.get_issue_content"></a>++### get_issue_content++```python+def get_issue_content(self, repo_name: str, issue_number: int):+```++Retrieves the content of a specific issue by its number.++**Parameters:**++- **repo_name** (str): The name of the GitHub repository.+- **issue_number** (int): The number of the issue to retrieve.++**Returns:**++ str: issues content details.++<a id="camel.toolkits.github_toolkit.GithubToolkit.get_pull_request_list"></a>++### get_pull_request_list++```python+def get_pull_request_list(+ self,+ repo_name: str,+ state: Literal['open', 'closed', 'all'] = 'all'+):+```++Retrieves all pull requests from the GitHub repository.++**Parameters:**++- **repo_name** (str): The name of the GitHub repository.+- **state** (`Literal["open", "closed", "all"]`): The state of pull requests to retrieve. (default: :obj:`all`) Options are: - "open": Retrieve only open pull requests. - "closed": Retrieve only closed pull requests. - "all": Retrieve all pull requests, regardless of state.++**Returns:**++ list: A list of dictionaries where each dictionary contains the+pull request number and title.++<a id="camel.toolkits.github_toolkit.GithubToolkit.get_pull_request_code"></a>++### get_pull_request_code++```python+def get_pull_request_code(self, repo_name: str, pr_number: int):+```++Retrieves the code changes of a specific pull request.++**Parameters:**++- **repo_name** (str): The name of the GitHub repository.+- **pr_number** (int): The number of the pull request to retrieve.++**Returns:**++ List[Dict[str, str]]: A list of dictionaries where each dictionary+contains the file name and the corresponding code changes+(patch).++<a id="camel.toolkits.github_toolkit.GithubToolkit.get_pull_request_comments"></a>++### get_pull_request_comments++```python+def get_pull_request_comments(self, repo_name: str, pr_number: int):+```++Retrieves the comments from a specific pull request.++**Parameters:**++- **repo_name** (str): The name of the GitHub repository.+- **pr_number** (int): The number of the pull request to retrieve.++**Returns:**++ List[Dict[str, str]]: A list of dictionaries where each dictionary+contains the user ID and the comment body.++<a id="camel.toolkits.github_toolkit.GithubToolkit.get_all_file_paths"></a>++### get_all_file_paths++```python+def get_all_file_paths(self, repo_name: str, path: str = ''):+```++Recursively retrieves all file paths in the GitHub repository.++**Parameters:**++- **repo_name** (str): The name of the GitHub repository.+- **path** (str): The repository path to start the traversal from. empty string means starts from the root directory. (default: :obj:`""`)++**Returns:**++ List[str]: A list of file paths within the specified directory+structure.++<a id="camel.toolkits.github_toolkit.GithubToolkit.retrieve_file_content"></a>++### retrieve_file_content++```python+def retrieve_file_content(self, repo_name: str, file_path: str):+```++Retrieves the content of a file from the GitHub repository.++**Parameters:**++- **repo_name** (str): The name of the GitHub repository.+- **file_path** (str): The path of the file to retrieve.++**Returns:**++ str: The decoded content of the file.++<a id="camel.toolkits.github_toolkit.GithubToolkit.get_tools"></a>++### get_tools++```python+def get_tools(self):+```++**Returns:**++ List[FunctionTool]: A list of FunctionTool objects representing+the functions in the toolkit.diff --git a/docs/reference/camel.toolkits.pptx_toolkit.md b/docs/reference/camel.toolkits.pptx_toolkit.mdnew file mode 100644index 000000000..9bd7b1ce4--- /dev/null+++ b/docs/reference/camel.toolkits.pptx_toolkit.md@@ -0,0 +1,333 @@+<a id="camel.toolkits.pptx_toolkit"></a>++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit"></a>++## PPTXToolkit++```python+class PPTXToolkit(BaseToolkit):+```++A toolkit for creating and writing PowerPoint presentations (PPTX+files).++This class provides cross-platform support for creating PPTX files with+title slides, content slides, text formatting, and image embedding.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit.__init__"></a>++### __init__++```python+def __init__(self, output_dir: str = './', timeout: Optional[float] = None):+```++Initialize the PPTXToolkit.++**Parameters:**++- **output_dir** (str): The default directory for output files. Defaults to the current working directory.+- **timeout** (Optional[float]): The timeout for the toolkit. (default: :obj:`None`)++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._resolve_filepath"></a>++### _resolve_filepath++```python+def _resolve_filepath(self, file_path: str):+```++Convert the given string path to a Path object.++If the provided path is not absolute, it is made relative to the+default output directory. The filename part is sanitized to replace+spaces and special characters with underscores, ensuring safe usage+in downstream processing.++**Parameters:**++- **file_path** (str): The file path to resolve.++**Returns:**++ Path: A fully resolved (absolute) and sanitized Path object.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._sanitize_filename"></a>++### _sanitize_filename++```python+def _sanitize_filename(self, filename: str):+```++Sanitize a filename by replacing special characters and spaces.++**Parameters:**++- **filename** (str): The filename to sanitize.++**Returns:**++ str: The sanitized filename.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._format_text"></a>++### _format_text++```python+def _format_text(+ self,+ frame_paragraph,+ text: str,+ set_color_to_white = False+):+```++Apply bold and italic formatting while preserving the original+word order.++**Parameters:**++- **frame_paragraph**: The paragraph to format.+- **text** (str): The text to format.+- **set_color_to_white** (bool): Whether to set the color to white. (default: :obj:`False`)++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._add_bulleted_items"></a>++### _add_bulleted_items++```python+def _add_bulleted_items(+ self,+ text_frame: 'TextFrame',+ flat_items_list: List[Tuple[str, int]],+ set_color_to_white: bool = False+):+```++Add a list of texts as bullet points and apply formatting.++**Parameters:**++- **text_frame** (TextFrame): The text frame where text is to be displayed.+- **flat_items_list** (List[Tuple[str, int]]): The list of items to be displayed.+- **set_color_to_white** (bool): Whether to set the font color to white. (default: :obj:`False`)++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._get_flat_list_of_contents"></a>++### _get_flat_list_of_contents++```python+def _get_flat_list_of_contents(self, items: List[Union[str, List[Any]]], level: int):+```++Flatten a hierarchical list of bullet points to a single list.++**Parameters:**++- **items** (List[Union[str, List[Any]]]): A bullet point (string or list).+- **level** (int): The current level of hierarchy.++**Returns:**++ List[Tuple[str, int]]: A list of (bullet item text, hierarchical+level) tuples.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._get_slide_width_height_inches"></a>++### _get_slide_width_height_inches++```python+def _get_slide_width_height_inches(self, presentation: 'presentation.Presentation'):+```++Get the dimensions of a slide in inches.++**Parameters:**++- **presentation** (presentation.Presentation): The presentation object.++**Returns:**++ Tuple[float, float]: The width and height in inches.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._write_pptx_file"></a>++### _write_pptx_file++```python+def _write_pptx_file(+ self,+ file_path: Path,+ content: List[Dict[str, Any]],+ template: Optional[str] = None+):+```++Write text content to a PPTX file with enhanced formatting.++**Parameters:**++- **file_path** (Path): The target file path.+- **content** (List[Dict[str, Any]]): The content to write to the PPTX file. Must be a list of dictionaries where: - First element: Title slide with keys 'title' and 'subtitle' - Subsequent elements: Content slides with keys 'title', 'text'+- **template** (Optional[str]): The name of the template to use. If not provided, the default template will be used. (default: :obj: `None`)++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit.create_presentation"></a>++### create_presentation++```python+def create_presentation(+ self,+ content: str,+ filename: str,+ template: Optional[str] = None+):+```++Create a PowerPoint presentation (PPTX) file.++**Parameters:**++- **content** (str): The content to write to the PPTX file as a JSON string. Must represent a list of dictionaries with the following structure: - First dict: title slide `{"title": str, "subtitle": str}` - Other dicts: content slides, which can be one of: * Bullet/step slides: `{"heading": str, "bullet_points": list of str or nested lists, "img_keywords": str (optional)}` - If any bullet point starts with '>> ', it will be rendered as a step-by-step process. - "img_keywords" can be a URL or search keywords for an image (optional). * Table slides: `{"heading": str, "table": {"headers": list of str, "rows": list of list of str}}`+- **filename** (str): The name or path of the file. If a relative path is supplied, it is resolved to self.output_dir.+- **template** (Optional[str]): The path to the template PPTX file. Initializes a presentation from a given template file Or PPTX file. (default: :obj:`None`)++**Returns:**++ str: A success message indicating the file was created.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._handle_default_display"></a>++### _handle_default_display++```python+def _handle_default_display(+ self,+ presentation: 'presentation.Presentation',+ slide_json: Dict[str, Any]+):+```++Display a list of text in a slide.++**Parameters:**++- **presentation** (presentation.Presentation): The presentation object.+- **slide_json** (Dict[str, Any]): The content of the slide as JSON data.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._handle_display_image__in_foreground"></a>++### _handle_display_image__in_foreground++```python+def _handle_display_image__in_foreground(+ self,+ presentation: 'presentation.Presentation',+ slide_json: Dict[str, Any]+):+```++Create a slide with text and image using a picture placeholder+layout.++**Parameters:**++- **presentation** (presentation.Presentation): The presentation object.+- **slide_json** (Dict[str, Any]): The content of the slide as JSON data.++**Returns:**++ bool: True if the slide has been processed.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._handle_table"></a>++### _handle_table++```python+def _handle_table(+ self,+ presentation: 'presentation.Presentation',+ slide_json: Dict[str, Any]+):+```++Add a table to a slide.++**Parameters:**++- **presentation** (presentation.Presentation): The presentation object.+- **slide_json** (Dict[str, Any]): The content of the slide as JSON data.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._handle_step_by_step_process"></a>++### _handle_step_by_step_process++```python+def _handle_step_by_step_process(+ self,+ presentation: 'presentation.Presentation',+ slide_json: Dict[str, Any],+ slide_width_inch: float,+ slide_height_inch: float+):+```++Add shapes to display a step-by-step process in the slide.++**Parameters:**++- **presentation** (presentation.Presentation): The presentation object.+- **slide_json** (Dict[str, Any]): The content of the slide as JSON data.+- **slide_width_inch** (float): The width of the slide in inches.+- **slide_height_inch** (float): The height of the slide in inches.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._remove_slide_number_from_heading"></a>++### _remove_slide_number_from_heading++```python+def _remove_slide_number_from_heading(self, header: str):+```++Remove the slide number from a given slide header.++**Parameters:**++- **header** (str): The header of a slide.++**Returns:**++ str: The header without slide number.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit._get_slide_placeholders"></a>++### _get_slide_placeholders++```python+def _get_slide_placeholders(self, slide: 'Slide'):+```++Return the index and name of all placeholders present in a slide.++**Parameters:**++- **slide** (Slide): The slide.++**Returns:**++ List[Tuple[int, str]]: A list containing placeholders (idx, name)+tuples.++<a id="camel.toolkits.pptx_toolkit.PPTXToolkit.get_tools"></a>++### get_tools++```python+def get_tools(self):+```++**Returns:**++ List[FunctionTool]: A list of FunctionTool objects+representing the functions in the toolkit.diff --git a/docs/reference/camel.toolkits.sympy_toolkit.md b/docs/reference/camel.toolkits.sympy_toolkit.mdnew file mode 100644index 000000000..960a5f70f--- /dev/null+++ b/docs/reference/camel.toolkits.sympy_toolkit.md@@ -0,0 +1,681 @@+<a id="camel.toolkits.sympy_toolkit"></a>++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit"></a>++## SymPyToolkit++```python+class SymPyToolkit(BaseToolkit):+```++A toolkit for performing symbolic computations using SymPy.+This includes methods for Algebraic manipulation calculus+and Linear Algebra.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.__init__"></a>++### __init__++```python+def __init__(+ self,+ default_variable: str = 'x',+ timeout: Optional[float] = None+):+```++Initializes the toolkit with a default variable and logging.++**Parameters:**++- **default_variable** (str): The default variable for operations (default: :obj:`x`)++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.simplify_expression"></a>++### simplify_expression++```python+def simplify_expression(self, expression: str):+```++Simplifies a mathematical expression.++**Parameters:**++- **expression** (str): The mathematical expression to simplify, provided as a string.++**Returns:**++ str: JSON string containing the simplified mathematical+expression in the `"result"` field. If an error occurs,+the `"status"` field will be set to `"error"` with a+corresponding `"message"`.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.expand_expression"></a>++### expand_expression++```python+def expand_expression(self, expression: str):+```++Expands an algebraic expression.++**Parameters:**++- **expression** (str): The algebraic expression to expand, provided as a string.++**Returns:**++ str: JSON string containing the expanded algebraic expression+in the `"result"` field. If an error occurs, the JSON+string will include an `"error"` field with the corresponding+error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.factor_expression"></a>++### factor_expression++```python+def factor_expression(self, expression: str):+```++Factors an algebraic expression.++**Parameters:**++- **expression** (str): The algebraic expression to factor, provided as a string.++**Returns:**++ str: JSON string containing the factored algebraic expression+in the `"result"` field. If an error occurs, the JSON string+will include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.solve_linear_system"></a>++### solve_linear_system++```python+def solve_linear_system(self, equations: List[str], variables: List[str]):+```++Solves a system of linear equations.++**Parameters:**++- **equations** (List[str]): A list of strings representing the linear equations to be solved.+- **variables** (List[str]): A list of strings representing the variables involved in the equations.++**Returns:**++ str: JSON string containing the solution to the system of equations+in the `"result"` field. Each solution is represented as+a tuple of values corresponding to the variables. If an+error occurs, the JSON string will include an `"error"`+field with the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.solve_nonlinear_system"></a>++### solve_nonlinear_system++```python+def solve_nonlinear_system(self, sympy_equations: List[str], variables: List[str]):+```++Solves a system of nonlinear equations.++**Parameters:**++- **sympy_equations** (List[str]): A list of strings representing the nonlinear equations to be solved. The equation to solve, must be compatible with SymPy, provided as a string.+- **variables** (List[str]): A list of strings representing the variables involved in the equations.++**Returns:**++ str: JSON string containing the solutions to the system of+equations in the `"result"` field. Each solution is+represented as a tuple of values corresponding to the+variables. If an error occurs, the JSON string will+include an `"error"` field with the corresponding+error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.solve_univariate_inequality"></a>++### solve_univariate_inequality++```python+def solve_univariate_inequality(self, inequality: str, variable: str):+```++Solves a single-variable inequality.++**Parameters:**++- **inequality** (str): A string representing the inequality to be solved.+- **variable** (str): The variable in the inequality.++**Returns:**++ str: JSON string containing the solution to the inequality in the+`"result"` field. The solution is represented in a symbolic+format (e.g., intervals or expressions). If an error occurs,+the JSON string will include an `"error"` field with the+corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.reduce_inequalities"></a>++### reduce_inequalities++```python+def reduce_inequalities(self, inequalities: List[str]):+```++Reduces a system of inequalities.++**Parameters:**++- **inequalities** (List[str]): A list of strings representing the inequalities to be reduced.++**Returns:**++ str: JSON string containing the reduced system of inequalities+in the `"result"` field. The solution is represented in+a symbolic format (e.g., combined intervals or expressions).+If an error occurs, the JSON string will include an `"error"`+field with the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.polynomial_representation"></a>++### polynomial_representation++```python+def polynomial_representation(self, expression: str, variable: str):+```++Represents an expression as a polynomial.++**Parameters:**++- **expression** (str): The mathematical expression to represent as a polynomial, provided as a string.+- **variable** (str): The variable with respect to which the polynomial representation will be created.++**Returns:**++ str: JSON string containing the polynomial representation of the+expression in the `"result"` field. The polynomial is returned+in a symbolic format. If an error occurs, the JSON string will+include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.polynomial_degree"></a>++### polynomial_degree++```python+def polynomial_degree(self, expression: str, variable: str):+```++Returns the degree of a polynomial.++**Parameters:**++- **expression** (str): The polynomial expression for which the degree is to be determined, provided as a string.+- **variable** (str): The variable with respect to which the degree of the polynomial is calculated.++**Returns:**++ str: JSON string containing the degree of the polynomial in the+`"result"` field. If an error occurs, the JSON string will+include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.polynomial_coefficients"></a>++### polynomial_coefficients++```python+def polynomial_coefficients(self, expression: str, variable: str):+```++Returns the coefficients of a polynomial.++**Parameters:**++- **expression** (str): The polynomial expression from which the coefficients are to be extracted, provided as a string.+- **variable** (str): The variable with respect to which the polynomial coefficients are determined.++**Returns:**++ str: JSON string containing the list of coefficients of the+polynomial in the `"result"` field. The coefficients are+ordered from the highest degree term to the constant term.+If an error occurs, the JSON string will include an `"error"+field with the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.solve_equation"></a>++### solve_equation++```python+def solve_equation(self, sympy_equation: str, variable: Optional[str] = None):+```++Solves an equation for a specific variable.++**Parameters:**++- **sympy_equation** (str): The equation to solve, must be compatible with SymPy, provided as a string.+- **variable** (str, optional): The variable to solve for. If not specified, the function will use the default variable.++**Returns:**++ str: JSON string containing the solutions to the equation in the+`"result"` field. Each solution is represented as a string.+If an error occurs, the JSON string will include an `"error"`+field with the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.find_roots"></a>++### find_roots++```python+def find_roots(self, expression: str):+```++Finds the roots of a polynomial or algebraic equation.++**Parameters:**++- **expression** (str): The polynomial or algebraic equation for which the roots are to be found, provided as a string.++**Returns:**++ str: JSON string containing the roots of the expression in the+`"result"` field. The roots are represented as a list of+solutions. If an error occurs, the JSON string will include+a `"status"` field set to `"error"` and a `"message"` field+with the corresponding error description.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.differentiate"></a>++### differentiate++```python+def differentiate(self, expression: str, variable: Optional[str] = None):+```++Differentiates an expression with respect to a variable.++**Parameters:**++- **expression** (str): The mathematical expression to differentiate, provided as a string.+- **variable** (str, optional): The variable with respect to which the differentiation is performed. If not specified, the default variable is used.++**Returns:**++ str: JSON string containing the derivative of the expression in the+`"result"` field. If an error occurs, the JSON string will+include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.integrate"></a>++### integrate++```python+def integrate(self, expression: str, variable: Optional[str] = None):+```++Integrates an expression with respect to a variable.++**Parameters:**++- **expression** (str): The mathematical expression to integrate, provided as a string.+- **variable** (str, optional): The variable with respect to which the integration is performed. If not specified, the default variable is used.++**Returns:**++ str: JSON string containing the integral of the expression in the+`"result"` field. If an error occurs, the JSON string will+include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.definite_integral"></a>++### definite_integral++```python+def definite_integral(+ self,+ expression: str,+ variable: str,+ lower: float,+ upper: float+):+```++Computes the definite integral of an expression within given+bounds.++**Parameters:**++- **expression** (str): The mathematical expression to integrate, provided as a string.+- **variable** (str): The variable with respect to which the definite integration is performed.+- **lower** (float): The lower limit of the integration.+- **upper** (float): The upper limit of the integration.++**Returns:**++ str: JSON string containing the result of the definite integral+in the `"result"` field. If an error occurs, the JSON string+will include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.series_expansion"></a>++### series_expansion++```python+def series_expansion(+ self,+ expression: str,+ variable: str,+ point: float,+ order: int+):+```++Expands an expression into a Taylor series around a given point up+to a specified order.++**Parameters:**++- **expression** (str): The mathematical expression to expand, provided as a string.+- **variable** (str): The variable with respect to which the series expansion is performed.+- **point** (float): The point around which the Taylor series is expanded.+- **order** (int): The order up to which the series expansion is computed.++**Returns:**++ str: JSON string containing the Taylor series expansion of the+expression in the `"result"` field. If an error occurs,+the JSON string will include an `"error"` field with the+corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.compute_limit"></a>++### compute_limit++```python+def compute_limit(+ self,+ expression: str,+ variable: str,+ point: float+):+```++Computes the limit of an expression as a variable approaches+a point.++**Parameters:**++- **expression** (str): The mathematical expression for which the limit is to be computed, provided as a string.+- **variable** (str): The variable with respect to which the limit is computed.+- **point** (float): The point that the variable approaches.++**Returns:**++ str: JSON string containing the computed limit of the expression+in the `"result"` field. If an error occurs, the JSON string+will include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.find_critical_points"></a>++### find_critical_points++```python+def find_critical_points(self, expression: str, variable: str):+```++Finds the critical points of an expression by setting its+derivative to zero.++**Parameters:**++- **expression** (str): The mathematical expression for which critical points are to be found, provided as a string.+- **variable** (str): The variable with respect to which the critical points are determined.++**Returns:**++ str: JSON string containing the critical points of the expression+in the `"result"` field. The critical points are returned as a+list of values corresponding to the variable. If an error+occurs, the JSON string will include an `"error"` field with+the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.check_continuity"></a>++### check_continuity++```python+def check_continuity(+ self,+ expression: str,+ variable: str,+ point: float+):+```++Checks if an expression is continuous at a given point.++**Parameters:**++- **expression** (str): The mathematical expression to check for continuity, provided as a string.+- **variable** (str): The variable with respect to which continuity is checked.+- **point** (float): The point at which the continuity of the expression is checked.++**Returns:**++ str: JSON string containing the result of the continuity check in+the `"result"` field. The result will be `"True"` if the+expression is continuous at the given point, otherwise+`"False"`. If an error occurs, the JSON string will include+an `"error"` field with the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.compute_determinant"></a>++### compute_determinant++```python+def compute_determinant(self, matrix: List[List[float]]):+```++Computes the determinant of a matrix.++**Parameters:**++- **matrix** (List[List[float]]): A two-dimensional list representing the matrix for which the determinant is to be computed.++**Returns:**++ str: JSON string containing the determinant of the matrix in the+`"result"` field. If an error occurs, the JSON string will+include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.compute_inverse"></a>++### compute_inverse++```python+def compute_inverse(self, matrix: List[List[float]]):+```++Computes the inverse of a matrix.++**Parameters:**++- **matrix** (List[List[float]]): A two-dimensional list representing the matrix for which the inverse is to be computed.++**Returns:**++ str: JSON string containing the inverse of the matrix in the+`"result"` field. The inverse is represented in a symbolic+matrix format. If an error occurs, the JSON string will+include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.compute_eigenvalues"></a>++### compute_eigenvalues++```python+def compute_eigenvalues(self, matrix: List[List[float]]):+```++Computes the eigenvalues of a matrix.++**Parameters:**++- **matrix** (List[List[float]]): A two-dimensional list representing the matrix for which the eigenvalues are to be computed.++**Returns:**++ str: JSON string containing the eigenvalues of the matrix in the+`"result"` field. The eigenvalues are represented as a+dictionary where keys are the eigenvalues (as strings) and+values are their multiplicities (as strings). If an error+occurs, the JSON string will include an `"error"` field+with the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.compute_eigenvectors"></a>++### compute_eigenvectors++```python+def compute_eigenvectors(self, matrix: List[List[float]]):+```++Computes the eigenvectors of a matrix.++**Parameters:**++- **matrix** (List[List[float]]): A two-dimensional list representing the matrix for which the eigenvectors are to be computed.++**Returns:**++ str: JSON string containing the eigenvectors of the matrix in the+`"result"` field. Each eigenvalue is represented as a+dictionary with the following keys:+- `"eigenvalue"`: The eigenvalue (as a string).+- `"multiplicity"`: The multiplicity of the eigenvalue+(as an integer).+- `"eigenvectors"`: A list of eigenvectors+(each represented as a string).++If an error occurs, the JSON string will include an `"error"`+field with the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.compute_nullspace"></a>++### compute_nullspace++```python+def compute_nullspace(self, matrix: List[List[float]]):+```++Computes the null space of a matrix.++**Parameters:**++- **matrix** (List[List[float]]): A two-dimensional list representing the matrix for which the null space is to be computed.++**Returns:**++ str: JSON string containing the null space of the matrix in the+`"result"` field. The null space is represented as a list of+basis vectors, where each vector is given as a string in+symbolic format. If an error occurs, the JSON string will+include an `"error"` field with the corresponding error+message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.compute_rank"></a>++### compute_rank++```python+def compute_rank(self, matrix: List[List[float]]):+```++Computes the rank of a matrix.++**Parameters:**++- **matrix** (List[List[float]]): A two-dimensional list representing the matrix for which the rank is to be computed.++**Returns:**++ str: JSON string containing the rank of the matrix in the+`"result"` field. The rank is represented as an integer.+If an error occurs,the JSON string will include an+`"error"` field with the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.compute_inner_product"></a>++### compute_inner_product++```python+def compute_inner_product(self, vector1: List[float], vector2: List[float]):+```++Computes the inner (dot) product of two vectors.++**Parameters:**++- **vector1** (List[float]): The first vector as a list of floats.+- **vector2** (List[float]): The second vector as a list of floats.++**Returns:**++ str: JSON string containing the inner product in the `"result"`+field. If an error occurs, the JSON string will include an+`"error"` field with the corresponding error message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.handle_exception"></a>++### handle_exception++```python+def handle_exception(self, func_name: str, error: Exception):+```++Handles exceptions by logging and returning error details.++**Parameters:**++- **func_name** (str): The name of the function where the exception occurred.+- **error** (Exception): The exception object containing details about the error.++**Returns:**++ str: JSON string containing the error details.+The JSON includes:+- `"status"`: Always set to `"error"`.+- `"message"`: A string representation of the+exception message.++<a id="camel.toolkits.sympy_toolkit.SymPyToolkit.get_tools"></a>++### get_tools++```python+def get_tools(self):+```++**Returns:**++ List[FunctionTool]: A list of `FunctionTool` objects representing+the toolkit's methods, making them accessible to the agent.diff --git a/docs/reference/camel.toolkits.task_planning_toolkit.md b/docs/reference/camel.toolkits.task_planning_toolkit.mdnew file mode 100644index 000000000..119a20cbb--- /dev/null+++ b/docs/reference/camel.toolkits.task_planning_toolkit.md@@ -0,0 +1,88 @@+<a id="camel.toolkits.task_planning_toolkit"></a>++<a id="camel.toolkits.task_planning_toolkit.TaskPlanningToolkit"></a>++## TaskPlanningToolkit++```python+class TaskPlanningToolkit(BaseToolkit):+```++A toolkit for task decomposition and re-planning.++<a id="camel.toolkits.task_planning_toolkit.TaskPlanningToolkit.__init__"></a>++### __init__++```python+def __init__(self, timeout: Optional[float] = None):+```++Initialize the TaskPlanningToolkit.++**Parameters:**++- **timeout** (Optional[float]): The timeout for the toolkit. (default: :obj:`None`)++<a id="camel.toolkits.task_planning_toolkit.TaskPlanningToolkit.decompose_task"></a>++### decompose_task++```python+def decompose_task(+ self,+ original_task_content: str,+ sub_task_contents: List[str],+ original_task_id: Optional[str] = None+):+```++Use the tool to decompose an original task into several sub-tasks.+It creates new Task objects from the provided original task content,+used when the original task is complex and needs to be decomposed.++**Parameters:**++- **original_task_content** (str): The content of the task to be decomposed.+- **sub_task_contents** (List[str]): A list of strings, where each string is the content for a new sub-task.+- **original_task_id** (Optional[str]): The id of the task to be decomposed. If not provided, a new id will be generated. (default: :obj:`None`)++**Returns:**++ List[Task]: A list of newly created sub-task objects.++<a id="camel.toolkits.task_planning_toolkit.TaskPlanningToolkit.replan_tasks"></a>++### replan_tasks++```python+def replan_tasks(+ self,+ original_task_content: str,+ sub_task_contents: List[str],+ original_task_id: Optional[str] = None+):+```++Use the tool to re_decompose a task into several subTasks.+It creates new Task objects from the provided original task content,+used when the decomposed tasks are not good enough to help finish+the task.++**Parameters:**++- **original_task_content** (str): The content of the task to be decomposed.+- **sub_task_contents** (List[str]): A list of strings, where each string is the content for a new sub-task.+- **original_task_id** (Optional[str]): The id of the task to be decomposed. (default: :obj:`None`)++**Returns:**++ List[Task]: Reordered or modified tasks.++<a id="camel.toolkits.task_planning_toolkit.TaskPlanningToolkit.get_tools"></a>++### get_tools++```python+def get_tools(self):+```diff --git a/docs/reference/camel.toolkits.thinking_toolkit.md b/docs/reference/camel.toolkits.thinking_toolkit.mdnew file mode 100644index 000000000..43a4743b5--- /dev/null+++ b/docs/reference/camel.toolkits.thinking_toolkit.md@@ -0,0 +1,180 @@+<a id="camel.toolkits.thinking_toolkit"></a>++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit"></a>++## ThinkingToolkit++```python+class ThinkingToolkit(BaseToolkit):+```++A toolkit for recording thoughts during reasoning processes.++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit.__init__"></a>++### __init__++```python+def __init__(self, timeout: Optional[float] = None):+```++Initialize the ThinkingToolkit.++**Parameters:**++- **timeout** (Optional[float]): The timeout for the toolkit. (default: :obj:`None`)++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit.plan"></a>++### plan++```python+def plan(self, plan: str):+```++Use the tool to create a plan or strategy.+This tool is for outlining the approach or steps to be taken before+starting the actual thinking process.++**Parameters:**++- **plan** (str): A forward-looking plan or strategy.++**Returns:**++ str: The recorded plan.++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit.hypothesize"></a>++### hypothesize++```python+def hypothesize(self, hypothesis: str):+```++Use the tool to form a hypothesis or make a prediction.+This tool is for making educated guesses or predictions based on+the plan, before detailed thinking.++**Parameters:**++- **hypothesis** (str): A hypothesis or prediction to test.++**Returns:**++ str: The recorded hypothesis.++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit.think"></a>++### think++```python+def think(self, thought: str):+```++Use the tool to think about something.+It will not obtain new information or change the database, but just+append the thought to the log. Use it for initial thoughts and+observations during the execution of the plan.++**Parameters:**++- **thought** (str): A thought to think about.++**Returns:**++ str: The recorded thought.++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit.contemplate"></a>++### contemplate++```python+def contemplate(self, contemplation: str):+```++Use the tool to deeply contemplate an idea or concept.+This tool is for deeper, more thorough exploration of thoughts,+considering multiple perspectives and implications. It's more+comprehensive than basic thinking but more focused than reflection.++**Parameters:**++- **contemplation** (str): A deeper exploration of thoughts or concepts.++**Returns:**++ str: The recorded contemplation.++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit.critique"></a>++### critique++```python+def critique(self, critique: str):+```++Use the tool to critically evaluate current thoughts.+This tool is for identifying potential flaws, biases, or+weaknesses in the current thinking process.++**Parameters:**++- **critique** (str): A critical evaluation of current thoughts.++**Returns:**++ str: The recorded critique.++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit.synthesize"></a>++### synthesize++```python+def synthesize(self, synthesis: str):+```++Use the tool to combine and integrate various thoughts.+This tool is for bringing together different thoughts, contemplations,+and critiques into a coherent understanding.++**Parameters:**++- **synthesis** (str): An integration of multiple thoughts and insights.++**Returns:**++ str: The recorded synthesis.++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit.reflect"></a>++### reflect++```python+def reflect(self, reflection: str):+```++Use the tool to reflect on the entire process.+This tool is for final evaluation of the entire thinking process,+including plans, hypotheses, thoughts, contemplations, critiques,+and syntheses.++**Parameters:**++- **reflection** (str): A comprehensive reflection on the process.++**Returns:**++ str: The recorded reflection.++<a id="camel.toolkits.thinking_toolkit.ThinkingToolkit.get_tools"></a>++### get_tools++```python+def get_tools(self):+```++**Returns:**++ List[FunctionTool]: A list of tools.