mgbam commited on
Commit
2f5219d
Β·
verified Β·
1 Parent(s): 99776c8

Update core/config.py

Browse files
Files changed (1) hide show
  1. core/config.py +12 -2
core/config.py CHANGED
@@ -5,8 +5,11 @@
5
  # PROJECT: CognitiveEDA v5.0 - The QuantumLeap Intelligence Platform
6
  #
7
  # DESCRIPTION: Centralized, environment-aware configuration management using
8
- # Pydantic for robust validation and type safety.
 
 
9
 
 
10
  from pydantic_settings import BaseSettings, SettingsConfigDict
11
 
12
  class AppConfig(BaseSettings):
@@ -16,7 +19,14 @@ class AppConfig(BaseSettings):
16
  APP_TITLE: str = "πŸš€ CognitiveEDA v5.0: The QuantumLeap Intelligence Platform"
17
  GEMINI_MODEL: str = 'gemini-1.5-flash-latest'
18
  MAX_UI_ROWS: int = 50_000
19
- GOOGLE_API_KEY: str
 
 
 
 
 
 
 
20
 
21
  # Pydantic settings configuration
22
  model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8', extra='ignore')
 
5
  # PROJECT: CognitiveEDA v5.0 - The QuantumLeap Intelligence Platform
6
  #
7
  # DESCRIPTION: Centralized, environment-aware configuration management using
8
+ # Pydantic for robust validation and type safety. This version is
9
+ # updated to allow the application to start even if the optional
10
+ # API key is missing.
11
 
12
+ from typing import Optional
13
  from pydantic_settings import BaseSettings, SettingsConfigDict
14
 
15
  class AppConfig(BaseSettings):
 
19
  APP_TITLE: str = "πŸš€ CognitiveEDA v5.0: The QuantumLeap Intelligence Platform"
20
  GEMINI_MODEL: str = 'gemini-1.5-flash-latest'
21
  MAX_UI_ROWS: int = 50_000
22
+
23
+ # --- ARCHITECTURAL IMPROVEMENT ---
24
+ # The GOOGLE_API_KEY is now optional. By setting the type to Optional[str]
25
+ # and the default to None, Pydantic will no longer raise a validation
26
+ # error if the key is not found in the environment. This allows the
27
+ # application to start successfully. The check for its existence will
28
+ # be performed at runtime in the callback logic.
29
+ GOOGLE_API_KEY: Optional[str] = None
30
 
31
  # Pydantic settings configuration
32
  model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8', extra='ignore')