mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-20 04:42:18 +03:00
5bbc72eb09
# Description - db for composite brains & repository - composite brains creation
14 lines
514 B
Python
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")
|