mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-29 18:11:52 +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")
|