mirror of
https://github.com/ijaric/voice_assistant.git
synced 2025-05-25 15:03:27 +00:00
21 lines
514 B
Python
21 lines
514 B
Python
import pydantic_settings
|
|
|
|
import tgbot.split_settings.utils as split_settings_utils
|
|
|
|
|
|
class ApiSettings(pydantic_settings.BaseSettings):
|
|
model_config = pydantic_settings.SettingsConfigDict(
|
|
env_file=split_settings_utils.ENV_PATH,
|
|
env_prefix="API_",
|
|
env_file_encoding="utf-8",
|
|
extra="ignore",
|
|
)
|
|
|
|
url: str = "127.0.0.1"
|
|
port: int = 8000
|
|
protocol: str = "http"
|
|
|
|
@property
|
|
def api_url(self) -> str:
|
|
return f"{self.protocol}://{self.url}:{self.port}"
|