mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2026-02-03 11:40:39 +03:00
add ci tests in docker compose (#11)
This commit is contained in:
@@ -13,7 +13,7 @@ DOMAIN="http://localhost"
|
||||
URL_PREFIX=
|
||||
|
||||
# set to true to start with webhook. Else bot will start on polling method
|
||||
START_WITH_WEBHOOK="true"
|
||||
START_WITH_WEBHOOK="false"
|
||||
|
||||
# quantity of workers for uvicorn
|
||||
WORKERS_COUNT=1
|
||||
|
||||
@@ -13,7 +13,7 @@ DOMAIN="http://localhost"
|
||||
URL_PREFIX=
|
||||
|
||||
# set to true to start with webhook. Else bot will start on polling method
|
||||
START_WITH_WEBHOOK="true"
|
||||
START_WITH_WEBHOOK="false"
|
||||
|
||||
# quantity of workers for uvicorn
|
||||
WORKERS_COUNT=1
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
from functools import cached_property
|
||||
from os import environ
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from constants import API_PREFIX
|
||||
from dotenv import load_dotenv
|
||||
from pydantic import HttpUrl
|
||||
from pydantic import HttpUrl, ValidationInfo, field_validator
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
BASE_DIR = Path(__file__).parent.parent
|
||||
@@ -51,6 +52,12 @@ class AppSettings(SentrySettings, BaseSettings):
|
||||
# Enable uvicorn reloading
|
||||
RELOAD: bool = False
|
||||
|
||||
@field_validator("START_WITH_WEBHOOK")
|
||||
def star_with_webhook_validator(cls, field_value: Any, info: ValidationInfo) -> Any:
|
||||
if field_value == "false":
|
||||
return False
|
||||
return field_value
|
||||
|
||||
@cached_property
|
||||
def api_prefix(self) -> str:
|
||||
if self.URL_PREFIX:
|
||||
|
||||
Reference in New Issue
Block a user