🐫 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
<a id="camel.toolkits.base"></a>
<a id="camel.toolkits.base.manual_timeout"></a>
## manual_timeout
```python
def manual_timeout(func: F):
```
Decorator to mark a function as having manual timeout handling.
Use this decorator on toolkit methods that manage their own timeout logic
internally but don't have a `timeout` parameter in their signature.
This prevents the automatic `with_timeout` wrapper from being applied
by `BaseToolkit`.
**Parameters:**
- **func** (F): The function to mark as having manual timeout handling.
**Returns:**
F: The same function with `_manual_timeout` attribute set to True.
<a id="camel.toolkits.base.BaseToolkit"></a>
## BaseToolkit
```python
class BaseToolkit:
```
Base class for toolkits.
**Parameters:**
- **timeout** (Optional[float]): The timeout for the toolkit.
<a id="camel.toolkits.base.BaseToolkit.__init__"></a>
### __init__
```python
def __init__(self, timeout: Optional[float] = Constants.TIMEOUT_THRESHOLD):
```
<a id="camel.toolkits.base.BaseToolkit.__init_subclass__"></a>
### __init_subclass__
```python
def __init_subclass__(cls, **kwargs):
```
<a id="camel.toolkits.base.BaseToolkit.get_tools"></a>
### get_tools
```python
def get_tools(self):
```
**Returns:**
List[FunctionTool]: A list of FunctionTool objects
representing the functions in the toolkit.
<a id="camel.toolkits.base.BaseToolkit.run_mcp_server"></a>
### run_mcp_server
```python
def run_mcp_server(self, mode: Literal['stdio', 'sse', 'streamable-http']):
```
Run the MCP server in the specified mode.
**Parameters:**
- **mode** (`Literal["stdio", "sse", "streamable-http"]`): The mode to run the MCP server in.
<a id="camel.toolkits.base.RegisteredAgentToolkit"></a>
## RegisteredAgentToolkit
```python
class RegisteredAgentToolkit:
```
Mixin class for toolkits that need to register a ChatAgent.
This mixin provides a standard interface for toolkits that require
a reference to a ChatAgent instance. The ChatAgent will check if a
toolkit has this mixin and automatically register itself.
<a id="camel.toolkits.base.RegisteredAgentToolkit.__init__"></a>
### __init__
```python
def __init__(self):
```
<a id="camel.toolkits.base.RegisteredAgentToolkit.agent"></a>
### agent
```python
def agent(self):
```
**Returns:**
Optional[ChatAgent]: The registered agent, or None if not
registered.
**Note:**
If None is returned, it means the toolkit has not been registered
with a ChatAgent yet. Make sure to pass this toolkit to a ChatAgent
via the toolkits parameter during initialization.
<a id="camel.toolkits.base.RegisteredAgentToolkit.register_agent"></a>
### register_agent
```python
def register_agent(self, agent: 'ChatAgent'):
```
Register a ChatAgent with this toolkit.
This method allows registering an agent after initialization. The
ChatAgent will automatically call this method if the toolkit to
register inherits from RegisteredAgentToolkit.
**Parameters:**
- **agent** (ChatAgent): The ChatAgent instance to register.