Configuration

This module contains functionality related to the the configuration module for augmentation.components.llms.openai.

Configuration

OpenAILLMConfiguration

Bases: LLMConfiguration

Configuration for OpenAI language models.

This class extends the base LLMConfiguration to provide OpenAI-specific configuration options and secrets management.

Source code in src/augmentation/components/llms/openai/configuration.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class OpenAILLMConfiguration(LLMConfiguration):
    """Configuration for OpenAI language models.

    This class extends the base LLMConfiguration to provide OpenAI-specific
    configuration options and secrets management.
    """

    class Secrets(BaseSecrets):
        """Secrets configuration for OpenAI API authentication.

        Contains sensitive information required to authenticate with the OpenAI API.
        Values can be provided through environment variables with the prefix RAG__LLMS__OPENAI__.
        """

        model_config = ConfigDict(
            env_file_encoding="utf-8",
            env_prefix="RAG__LLMS__OPENAI__",
            env_nested_delimiter="__",
            extra="ignore",
        )

        api_key: SecretStr = Field(
            ..., description="API key for the model provider."
        )

    provider: Literal[LLMProviderName.OPENAI] = Field(
        ..., description="The name of the language model provider."
    )
    secrets: Secrets = Field(
        None, description="The secrets for the language model."
    )

Secrets

Bases: BaseSecrets

Secrets configuration for OpenAI API authentication.

Contains sensitive information required to authenticate with the OpenAI API. Values can be provided through environment variables with the prefix RAG__LLMS__OPENAI__.

Source code in src/augmentation/components/llms/openai/configuration.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class Secrets(BaseSecrets):
    """Secrets configuration for OpenAI API authentication.

    Contains sensitive information required to authenticate with the OpenAI API.
    Values can be provided through environment variables with the prefix RAG__LLMS__OPENAI__.
    """

    model_config = ConfigDict(
        env_file_encoding="utf-8",
        env_prefix="RAG__LLMS__OPENAI__",
        env_nested_delimiter="__",
        extra="ignore",
    )

    api_key: SecretStr = Field(
        ..., description="API key for the model provider."
    )