FredyHoundayi commited on
Commit
99f98f2
·
1 Parent(s): 7fdf865

Fix pydantic validation: use Optional[str] for API keys to make them truly optional

Browse files
Files changed (1) hide show
  1. app/core/config.py +8 -9
app/core/config.py CHANGED
@@ -1,17 +1,16 @@
1
- from pydantic_settings import BaseSettings, SettingsConfigDict
 
2
 
3
 
4
  class Settings(BaseSettings):
5
- model_config = SettingsConfigDict(
6
- env_file=".env",
7
- env_ignore_empty=True,
8
- extra="ignore"
9
- )
10
-
11
- GROQ_API_KEY: str = ""
12
- OPENAI_API_KEY: str = ""
13
  DATABASE_URL: str = "sqlite:///./brain_platform.db"
14
  ENVIRONMENT: str = "development"
15
 
 
 
 
 
16
 
17
  settings = Settings()
 
1
+ from pydantic_settings import BaseSettings
2
+ from typing import Optional
3
 
4
 
5
  class Settings(BaseSettings):
6
+ GROQ_API_KEY: Optional[str] = None
7
+ OPENAI_API_KEY: Optional[str] = None
 
 
 
 
 
 
8
  DATABASE_URL: str = "sqlite:///./brain_platform.db"
9
  ENVIRONMENT: str = "development"
10
 
11
+ class Config:
12
+ env_file = ".env"
13
+ extra = "ignore"
14
+
15
 
16
  settings = Settings()