mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-20 12:51:33 +03:00
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")
|