2023-08-14 11:37:20 +00:00
|
|
|
from enum import StrEnum
|
|
|
|
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
|
|
|
|
|
|
class Model(StrEnum):
|
|
|
|
"""Model to use for the LLM Chat application."""
|
|
|
|
|
|
|
|
GPT3 = "gpt-3.5-turbo"
|
|
|
|
GPT4 = "gpt-4"
|
|
|
|
|
|
|
|
|
|
|
|
class OpenAISettings(BaseSettings):
|
|
|
|
"""Settings for the LLM Chat application."""
|
|
|
|
|
2023-08-16 09:10:06 +00:00
|
|
|
api_key: str = ""
|
2023-08-14 11:37:20 +00:00
|
|
|
model: Model = Model.GPT3
|
|
|
|
temperature: float = 0.7
|
|
|
|
|
2023-08-16 09:10:06 +00:00
|
|
|
model_config: SettingsConfigDict = SettingsConfigDict( # type: ignore[misc]
|
2023-08-14 11:37:20 +00:00
|
|
|
env_file=".env",
|
|
|
|
env_file_encoding="utf-8",
|
|
|
|
env_prefix="OPENAI_",
|
|
|
|
frozen=True,
|
|
|
|
use_enum_values=True,
|
|
|
|
)
|