refactor: Change class order in settings router
Changed class order in settings router to allow proper work of settings Refactor #COG-334
This commit is contained in:
parent
4fd4651471
commit
02d6750d05
1 changed files with 9 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue