> ## 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.

# components.Retrieval

> Retrieval functionality for Components integration.

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

## [RetrievalConfig](/sdk/python/references/logger/components/retrieval)

```python theme={null}
@deprecated(
    "This class will be removed in a future version. Use {} which is TypedDict."
)

@dataclass
class RetrievalConfig()
```

[Retrieval](/sdk/python/references/logger/components/retrieval) config.

This class provides functionality to manage retrieval configurations.

## [RetrievalConfigDict](/sdk/python/references/logger/components/retrieval)

```python theme={null}
class RetrievalConfigDict(TypedDict)
```

[Retrieval](/sdk/python/references/logger/components/retrieval) config dict.

This class provides functionality to manage retrieval config dictionaries.

#### get\_retrieval\_config\_dict

```python theme={null}
def get_retrieval_config_dict(
        config: Union[RetrievalConfig, RetrievalConfigDict]) -> dict[str, Any]
```

Get the retrieval config dict.

**Arguments**:

| Name     | Type                                                                                                                                                       | Description                      |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `config` | *Union\[[RetrievalConfig](/sdk/python/references/logger/components/retrieval), [RetrievalConfigDict](/sdk/python/references/logger/components/retrieval)]* | The config to get the dict from. |

**Returns**:

dict\[str, Any]: The retrieval config dict.

## [Retrieval](/sdk/python/references/logger/components/retrieval)

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

[Retrieval](/sdk/python/references/logger/components/retrieval).

This class represents a retrieval.

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

```python theme={null}
def __init__(config: Union[RetrievalConfig, RetrievalConfigDict],
             writer: LogWriter)
```

Initialize a retrieval.

**Arguments**:

| Name     | Description                                  |
| -------- | -------------------------------------------- |
| `config` | The config to initialize the retrieval with. |
| `writer` | The writer to use.                           |

#### input

```python theme={null}
def input(query: str)
```

Set the input for the retrieval.

**Arguments**:

| Name    | Description                         |
| ------- | ----------------------------------- |
| `query` | The query to set for the retrieval. |

#### input\_

```python theme={null}
@staticmethod
def input_(writer: LogWriter, id: str, query: str)
```

Set the input for the retrieval.

**Arguments**:

| Name     | Description                         |
| -------- | ----------------------------------- |
| `writer` | The writer to use.                  |
| `id`     | The id of the retrieval.            |
| `query`  | The query to set for the retrieval. |

#### output

```python theme={null}
def output(docs: Union[str, List[str]])
```

Set the output for the retrieval.

**Arguments**:

| Name   | Description                        |
| ------ | ---------------------------------- |
| `docs` | The docs to set for the retrieval. |

#### add\_attachment

```python theme={null}
def add_attachment(attachment: Union[FileAttachment, FileDataAttachment,
                                     UrlAttachment])
```

Add an attachment to the retrieval.

**Arguments**:

| Name         | Description                             |
| ------------ | --------------------------------------- |
| `attachment` | The attachment to add to the retrieval. |

#### add\_attachment\_

```python theme={null}
@staticmethod
def add_attachment_(writer: LogWriter, id: str,
                    attachment: Union[FileAttachment, FileDataAttachment,
                                      UrlAttachment])
```

Add an attachment to the retrieval.

**Arguments**:

| Name         | Description                             |
| ------------ | --------------------------------------- |
| `writer`     | The writer to use.                      |
| `id`         | The id of the retrieval.                |
| `attachment` | The attachment to add to the retrieval. |

#### output\_

```python theme={null}
@staticmethod
def output_(writer: LogWriter, id: str, docs: Union[str, List[str]])
```

Set the output for the retrieval.

**Arguments**:

| Name     | Description                        |
| -------- | ---------------------------------- |
| `writer` | The writer to use.                 |
| `id`     | The id of the retrieval.           |
| `docs`   | The docs to set for the retrieval. |

#### end\_

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

End the retrieval.

**Arguments**:

| Name     | Description                        |
| -------- | ---------------------------------- |
| `writer` | The writer to use.                 |
| `id`     | The id of the retrieval.           |
| `data`   | The data to set for the retrieval. |

#### add\_tag\_

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

Add a tag to the retrieval.

**Arguments**:

| Name     | Description              |
| -------- | ------------------------ |
| `writer` | The writer to use.       |
| `id`     | The id of the retrieval. |
| `key`    | The key of the tag.      |
| `value`  | The value of the tag.    |
