Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

1.7 KB
Raw Blame
<a id="camel.runtimes.base"></a>

<a id="camel.runtimes.base.BaseRuntime"></a>

## BaseRuntime

```python
class BaseRuntime(ABC):
```

An abstract base class for all CAMEL runtimes.

<a id="camel.runtimes.base.BaseRuntime.__init__"></a>

### __init__

```python
def __init__(self):
```

<a id="camel.runtimes.base.BaseRuntime.add"></a>

### add

```python
def add(
    self,
    funcs: Union[FunctionTool, List[FunctionTool]],
    *args: Any,
    **kwargs: Any
):
```

Adds a new tool to the runtime.

<a id="camel.runtimes.base.BaseRuntime.reset"></a>

### reset

```python
def reset(self, *args: Any, **kwargs: Any):
```

Resets the runtime to its initial state.

<a id="camel.runtimes.base.BaseRuntime.cleanup"></a>

### cleanup

```python
def cleanup(self):
```

Releases resources (containers, processes, connections, etc.).

Public part of the runtime lifecycle API: callers may call
:meth:`cleanup` or use the runtime as a context manager
(`__INLINE_CODE_1__`) for deterministic teardown. Subclasses must
implement this method.

<a id="camel.runtimes.base.BaseRuntime.stop"></a>

### stop

```python
def stop(self):
```

**Returns:**

  BaseRuntime: The current runtime (for chaining).

<a id="camel.runtimes.base.BaseRuntime.__enter__"></a>

### __enter__

```python
def __enter__(self):
```

Enter the context manager.

<a id="camel.runtimes.base.BaseRuntime.__exit__"></a>

### __exit__

```python
def __exit__(
    self,
    exc_type: type[BaseException] | None,
    exc_val: BaseException | None,
    exc_tb: Any | None
):
```

Exit the context manager; ensures cleanup is called.

<a id="camel.runtimes.base.BaseRuntime.get_tools"></a>

### get_tools

```python
def get_tools(self):
```

Returns a list of all tools in the runtime.