gerd.models.gen
Models for the generation and chat service.
Classes:
Name | Description |
---|---|
GenerationConfig |
Configuration for the generation services. |
GenerationFeaturesConfig |
Configuration for the generation-specific features. |
GenerationConfig
Bases: BaseSettings
Configuration for the generation services.
A configuration can be used for the [GenerationService][gerd.services.generation.GenerationService] or the [ChatService][gerd.services.chat.ChatService]. Both support to generate text based on a prompt.
Methods:
Name | Description |
---|---|
settings_customise_sources |
Customize the settings sources used by pydantic-settings. |
Attributes:
Name | Type | Description |
---|---|---|
features |
GenerationFeaturesConfig
|
The extra features to be used for the generation service. |
model |
ModelConfig
|
The model to be used for the generation service. |
features
class-attribute
instance-attribute
The extra features to be used for the generation service.
model
class-attribute
instance-attribute
The model to be used for the generation service.
settings_customise_sources
classmethod
settings_customise_sources(_: 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/models/gen.py
GenerationFeaturesConfig
Bases: BaseModel
Configuration for the generation-specific features.
Attributes:
Name | Type | Description |
---|---|---|
prompt_chaining |
PromptChainingConfig | None
|
Configuration for prompt chaining. |