* migrate to pyright * Refactor type checking to use Pyright, update dependencies, and clean up code. - Replaced MyPy with Pyright in configuration files and CI workflows. - Updated `pyproject.toml` and `uv.lock` to reflect new dependencies and versions. - Adjusted type hints and fixed minor code issues across various modules for better compatibility with Pyright. - Added new packages `backoff` and `posthog` to the project dependencies. * Update CI workflows to install all extra dependencies for type checking and unit tests * Update dependencies in uv.lock to replace MyPy with Pyright and add nodeenv package. Adjust type hinting in config.py for compatibility with Pyright.
26 lines
663 B
Python
26 lines
663 B
Python
from functools import lru_cache
|
|
from typing import Annotated
|
|
|
|
from fastapi import Depends
|
|
from pydantic import Field
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict # type: ignore
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
openai_api_key: str
|
|
openai_base_url: str | None = Field(None)
|
|
model_name: str | None = Field(None)
|
|
embedding_model_name: str | None = Field(None)
|
|
neo4j_uri: str
|
|
neo4j_user: str
|
|
neo4j_password: str
|
|
|
|
model_config = SettingsConfigDict(env_file='.env', extra='ignore')
|
|
|
|
|
|
@lru_cache
|
|
def get_settings():
|
|
return Settings() # type: ignore[call-arg]
|
|
|
|
|
|
ZepEnvDep = Annotated[Settings, Depends(get_settings)]
|