> ## Documentation Index
> Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Base

> Base functionality for Components integration.

[View module source on GitHub](https://github.com/maximhq/maxim-py/blob/main/maxim/logger/components/base.py)

## [EvaluateContainerWithVariables](/docs/sdk/python/references/logger/components/base)

```python theme={null}
class EvaluateContainerWithVariables()
```

Evaluate container with variables.

This class provides functionality to manage evaluators with variables.

#### \_\_init\_\_

```python theme={null}
def __init__(id: str, entity: Entity, log_writer: LogWriter,
             for_evaluators: List[str]) -> None
```

Initialize the evaluate container with variables.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `id` | *str* | The ID of the evaluate container. |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity of the evaluate container. |
| `log_writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The log writer of the evaluate container. |
| `for_evaluators` | *List\[str]* | The evaluators of the evaluate container. |

#### with\_variables

```python theme={null}
def with_variables(variables: Dict[str, str])
```

With variables.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `variables` | *Dict\[str, str]* | The variables to use for the evaluate container. |

## [EvaluateContainer](/docs/sdk/python/references/logger/components/base)

```python theme={null}
class EvaluateContainer()
```

Evaluate container.

This class provides functionality to manage evaluators for a specific entity.

**Attributes**:

| Name | Type | Description |
| - | - | - |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity associated with these evaluators. |
| `writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The log writer used for committing evaluator actions. |
| `evaluators` | *List\[str]* | A list of evaluator identifiers. |
| `id` | *str* | A unique identifier for this set of evaluators. |

**Methods**:

* `with_variables` - Allows adding variables to be used by the evaluators.

#### \_\_init\_\_

```python theme={null}
def __init__(id: str, entity: Entity, log_writer: LogWriter) -> None
```

Initialize the evaluate container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `id` | *str* | The ID of the evaluate container. |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity of the evaluate container. |
| `log_writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The log writer of the evaluate container. |

#### with\_variables

```python theme={null}
def with_variables(variables: Dict[str, str], for_evaluators: List[str])
```

With variables.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `variables` | *Dict\[str, str]* | The variables to use for the evaluate container. |
| `for_evaluators` | *List\[str]* | The evaluators of the evaluate container. |

#### with\_evaluators

```python theme={null}
def with_evaluators(*evaluators: str) -> EvaluateContainerWithVariables
```

With evaluators.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `*evaluators` | *str* | The evaluators to use for the evaluate container. |

**Returns**:

| Name | Description |
| - | - |
| `[EvaluateContainerWithVariables](/sdk/python/references/logger/components/base)` | The evaluate container with variables. |

## [BaseContainer](/docs/sdk/python/references/logger/components/base)

```python theme={null}
class BaseContainer()
```

Base container.

This class provides functionality to manage containers for a specific entity.

#### \_\_init\_\_

```python theme={null}
def __init__(entity: Entity, config: BaseConfig, writer: LogWriter)
```

Initialize the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity of the base container. |
| `config` | *BaseConfig* | The config of the base container. |
| `writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The writer of the base container. |

#### id

```python theme={null}
@property
def id() -> str
```

Get the ID of the base container.

**Returns**:

| Name | Description |
| - | - |
| `str` | The ID of the base container. |

#### evaluate

```python theme={null}
def evaluate() -> EvaluateContainer
```

Evaluate the base container.

**Returns**:

| Name | Description |
| - | - |
| `[EvaluateContainer](/sdk/python/references/logger/components/base)` | The evaluate container. |

#### \_evaluate\_

```python theme={null}
@staticmethod
def _evaluate_(writer: LogWriter, entity: Entity,
               id: str) -> EvaluateContainer
```

Evaluate the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The writer of the base container. |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity of the base container. |
| `id` | *str* | The ID of the base container. |

#### add\_metadata

```python theme={null}
def add_metadata(metadata: Dict[str, Any]) -> None
```

Add metadata to the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `metadata` | *Dict\[str, Any]* | The metadata to add to the base container. |

#### add\_metadata\_

```python theme={null}
@staticmethod
def add_metadata_(writer: LogWriter, entity: Entity, id: str,
                  metadata: Dict[str, Any]) -> None
```

Add metadata to the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The writer of the base container. |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity of the base container. |
| `id` | *str* | The ID of the base container. |
| `metadata` | *Dict\[str, Any]* | The metadata to add to the base container. |

#### add\_tag

```python theme={null}
def add_tag(key: str, value: str)
```

Add a tag to the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `key` | *str* | The key of the tag. |
| `value` | *str* | The value of the tag. |

#### \_add\_tag\_

```python theme={null}
@staticmethod
def _add_tag_(writer: LogWriter, entity: Entity, id: str, key: str,
              value: str)
```

Add a tag to the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The writer of the base container. |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity of the base container. |
| `id` | *str* | The ID of the base container. |
| `key` | *str* | The key of the tag. |
| `value` | *str* | The value of the tag. |

#### end

```python theme={null}
def end()
```

End the base container.

This method is used to end the base container.

#### \_end\_

```python theme={null}
@staticmethod
def _end_(writer: LogWriter,
          entity: Entity,
          id: str,
          data: Optional[Dict[str, Any]] = None)
```

End the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The writer of the base container. |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity of the base container. |
| `id` | *str* | The ID of the base container. |
| `data` | *Optional\[Dict\[str, Any]]* | The data to add to the base container. |

#### data

```python theme={null}
def data() -> Dict[str, Any]
```

Get the data of the base container.

**Returns**:

Dict\[str, Any]: The data of the base container.

#### \_commit\_

```python theme={null}
@staticmethod
def _commit_(writer: LogWriter,
             entity: Entity,
             id: str,
             action: str,
             data: Optional[Dict[str, Any]] = None)
```

Commit the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The writer of the base container. |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity of the base container. |
| `id` | *str* | The ID of the base container. |
| `action` | *str* | The action to commit. |
| `data` | *Optional\[Dict\[str, Any]]* | The data to commit. |

## [EventEmittingBaseContainer](/docs/sdk/python/references/logger/components/base)

```python theme={null}
class EventEmittingBaseContainer(BaseContainer)
```

#### \_event\_

```python theme={null}
@staticmethod
def _event_(writer: LogWriter,
            entity: Entity,
            entity_id: str,
            id: str,
            name: str,
            tags: Optional[Dict[str, str]] = None,
            metadata: Optional[Dict[str, Any]] = None)
```

Add an event to the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `writer` | *[LogWriter](/docs/sdk/python/references/logger/writer)* | The writer of the base container. |
| `entity` | *[Entity](/docs/sdk/python/references/logger/components/types)* | The entity of the base container. |
| `entity_id` | *str* | The ID of the entity. |
| `id` | *str* | The ID of the event. |
| `name` | *str* | The name of the event. |
| `tags` | *Optional\[Dict\[str, str]]* | The tags of the event. |
| `metadata` | *Optional\[Dict\[str, Any]]* | The metadata of the event. |

#### event

```python theme={null}
def event(id: str,
          name: str,
          tags: Optional[Dict[str, str]] = None,
          metadata: Optional[Dict[str, Any]] = None)
```

Add an event to the base container.

**Arguments**:

| Name | Type | Description |
| - | - | - |
| `id` | *str* | The ID of the event. |
| `name` | *str* | The name of the event. |
| `tags` | *Optional\[Dict\[str, str]]* | The tags of the event. |
| `metadata` | *Optional\[Dict\[str, Any]]* | The metadata of the event. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.