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.
View module source on GitHub
@deprecated(
"This class will be removed in a future version. Use {} which is TypedDict."
)
@dataclass
class RetrievalConfig()
Retrieval config.
This class provides functionality to manage retrieval configurations.
class RetrievalConfigDict(TypedDict)
Retrieval config dict.
This class provides functionality to manage retrieval config dictionaries.
get_retrieval_config_dict
def get_retrieval_config_dict(
config: Union[RetrievalConfig, RetrievalConfigDict]) -> dict[str, Any]
Get the retrieval config dict.
Arguments:
| Name | Type | Description |
|---|
config | Union[RetrievalConfig, RetrievalConfigDict] | The config to get the dict from. |
Returns:
dict[str, Any]: The retrieval config dict.
class Retrieval(BaseContainer)
Retrieval.
This class represents a retrieval.
__init__
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. |
Set the input for the retrieval.
Arguments:
| Name | Description |
|---|
query | The query to set for the retrieval. |
@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
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
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_
@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_
@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_
@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_
@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. |