quivr/backend/modules/brain/service/utils/validate_brain.py
Zineb El Bachiri 5bbc72eb09
feat: composite brains db (#1826)
# Description

- db for composite brains & repository
- composite brains creation
2023-12-06 08:40:18 +01:00

14 lines
514 B
Python

from fastapi import HTTPException
from modules.brain.dto.inputs import CreateBrainProperties
def validate_api_brain(brain: CreateBrainProperties):
if brain.brain_definition is None:
raise HTTPException(status_code=404, detail="Brain definition not found")
if brain.brain_definition.url is None:
raise HTTPException(status_code=404, detail="Brain url not found")
if brain.brain_definition.method is None:
raise HTTPException(status_code=404, detail="Brain method not found")