gerd.config
Configuration for the application.
Classes:
Name | Description |
---|---|
EnvVariables |
Environment variables. |
Settings |
Settings for the application. |
YamlConfig |
YAML configuration source. |
Functions:
Name | Description |
---|---|
load_gen_config |
Load the LLM model configuration. |
load_qa_config |
Load the LLM model configuration. |
Attributes:
Name | Type | Description |
---|---|---|
CONFIG |
The global configuration object. |
EnvVariables
Bases: BaseModel
Environment variables.
Settings
Bases: BaseSettings
Settings for the application.
Methods:
Name | Description |
---|---|
settings_customise_sources |
Customize the settings sources used by pydantic-settings. |
settings_customise_sources
classmethod
settings_customise_sources(settings_cls: Type[BaseSettings], init_settings: PydanticBaseSettingsSource, env_settings: PydanticBaseSettingsSource, dotenv_settings: PydanticBaseSettingsSource, file_secret_settings: PydanticBaseSettingsSource) -> Tuple[PydanticBaseSettingsSource, ...]
Customize the settings sources used by pydantic-settings.
The order of the sources is important. The first source has the highest priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
The class of the settings. |
required | |
|
PydanticBaseSettingsSource
|
The settings from the initialization. |
required |
|
PydanticBaseSettingsSource
|
The settings from the environment. |
required |
|
PydanticBaseSettingsSource
|
The settings from the dotenv file. |
required |
|
PydanticBaseSettingsSource
|
The settings from the secret file. |
required |
Returns:
Type | Description |
---|---|
Tuple[PydanticBaseSettingsSource, ...]
|
The customized settings sources. |
Source code in gerd/config.py
YamlConfig
Bases: PydanticBaseSettingsSource
YAML configuration source.
Methods:
Name | Description |
---|---|
get_field_value |
Overrides a method from |
get_field_value
Overrides a method from PydanticBaseSettingsSource
.
Fails if it should ever be called. Parameters: field: The field to get the value for. field_name: The name of the field.
Raises:
Type | Description |
---|---|
NotImplementedError
|
Always. |
Source code in gerd/config.py
load_gen_config
Load the LLM model configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The name of the configuration. |
'gen_default'
|
Returns:
Type | Description |
---|---|
GenerationConfig
|
The model configuration. |
Source code in gerd/config.py
load_qa_config
Load the LLM model configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The name of the configuration. |
'qa_default'
|
Returns:
Type | Description |
---|---|
QAConfig
|
The model configuration. |