Configuration

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

Configuration

OpenAILikeLLMConfiguration

Bases: LLMConfiguration

Configuration for OpenAI-compatible language model providers.

This class defines the configuration settings needed to interact with APIs that follow OpenAI's API patterns, including authentication and context window settings.

Source code in src/augmentation/components/llms/openai_like/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
43
44
45
46
47
48
49
50
51
class OpenAILikeLLMConfiguration(LLMConfiguration):
    """
    Configuration for OpenAI-compatible language model providers.

    This class defines the configuration settings needed to interact with APIs
    that follow OpenAI's API patterns, including authentication and context
    window settings.
    """

    class Secrets(BaseSecrets):
        """
        Secret configuration values required for authentication with OpenAI-like APIs.

        This class stores sensitive information needed to connect to the API
        and supports loading values from environment variables.
        """

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

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

    provider: Literal[LLMProviderName.OPENAI_LIKE] = Field(
        ..., description="The name of the language model provider."
    )
    secrets: Secrets = Field(
        None, description="The secrets for the language model."
    )
    context_window: int = Field(
        ..., description="The context window size for the language model."
    )

Secrets

Bases: BaseSecrets

Secret configuration values required for authentication with OpenAI-like APIs.

This class stores sensitive information needed to connect to the API and supports loading values from environment variables.

Source code in src/augmentation/components/llms/openai_like/configuration.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class Secrets(BaseSecrets):
    """
    Secret configuration values required for authentication with OpenAI-like APIs.

    This class stores sensitive information needed to connect to the API
    and supports loading values from environment variables.
    """

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

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