Spaces:
Running
Running
File size: 449 Bytes
e1bc29c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from rag_retriver import Vector_search, GPT_completion_with_vector_search
from fastapi import FastAPI
from pydantic import BaseModel
#Pydantic object
class validation(BaseModel):
prompt: str
#Fast API
app = FastAPI()
@app.post("/Gathnex_Rag_System")
async def retrival_augmented_generation(item: validation):
rag = Vector_search(item.prompt)
completion = GPT_completion_with_vector_search(item.prompt, rag)
return completion
|