From 02d6750d058bc1ae556c82e84712abe452c0859f Mon Sep 17 00:00:00 2001 From: Igor Ilic Date: Thu, 24 Oct 2024 18:49:39 +0200 Subject: [PATCH] refactor: Change class order in settings router Changed class order in settings router to allow proper work of settings Refactor #COG-334 --- .../v1/settings/routers/get_settings_router.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cognee/api/v1/settings/routers/get_settings_router.py b/cognee/api/v1/settings/routers/get_settings_router.py index 38bf8f19c..7f3b09516 100644 --- a/cognee/api/v1/settings/routers/get_settings_router.py +++ b/cognee/api/v1/settings/routers/get_settings_router.py @@ -16,6 +16,15 @@ def get_settings_router(): class VectorDBConfigDTO(OutDTO, VectorDBConfig): pass + class SettingsDTO(OutDTO): + llm: LLMConfigDTO + vector_db: VectorDBConfigDTO + + @router.get("/", response_model=SettingsDTO) + async def get_settings(user: User = Depends(get_authenticated_user)): + from cognee.modules.settings import get_settings as get_cognee_settings + return get_cognee_settings() + class LLMConfigDTO(InDTO): provider: Union[Literal["openai"], Literal["ollama"], Literal["anthropic"]] model: str @@ -26,15 +35,6 @@ def get_settings_router(): url: str api_key: str - class SettingsDTO(OutDTO): - llm: LLMConfigDTO - vector_db: VectorDBConfigDTO - - @router.get("/", response_model=SettingsDTO) - async def get_settings(user: User = Depends(get_authenticated_user)): - from cognee.modules.settings import get_settings as get_cognee_settings - return get_cognee_settings() - class SettingsPayloadDTO(InDTO): llm: Optional[LLMConfigDTO] = None vector_db: Optional[VectorDBConfigDTO] = None