File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 22Configuration management for the embed-rerank API.
33"""
44
5- import os
65import platform
76from pathlib import Path
87from typing import Literal , Optional , List
98
109from pydantic import Field , field_validator , ValidationInfo
11- from pydantic_settings import BaseSettings
10+ from pydantic_settings import BaseSettings , SettingsConfigDict
1211
1312
1413class Settings (BaseSettings ):
@@ -98,15 +97,12 @@ def validate_log_level(cls, v: str) -> str:
9897 raise ValueError (f"Log level must be one of: { valid_levels } " )
9998 return v .upper ()
10099
101- class Config :
102- env_file = ".env"
103- env_prefix = ""
104- case_sensitive = False
105- # Allow unknown environment variables so adding extra operational
106- # settings in .env (e.g., debug, enable_cors, metrics_port) does not
107- # trigger ValidationError. They will simply be ignored unless
108- # explicitly defined as model fields.
109- extra = "ignore"
100+ # Pydantic v2 settings configuration
101+ model_config = SettingsConfigDict (
102+ env_file = ".env" ,
103+ case_sensitive = False ,
104+ extra = "ignore" , # ignore unknown keys (backward compatibility with older .env entries)
105+ )
110106
111107
112108# Global settings instance
You can’t perform that action at this time.
0 commit comments