File size: 391 Bytes
1ad8356
beaf4f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from rag_retriver import vector_search, cohere_completion_with_vector_search
from fastapi import FastAPI 
from pydantic import BaseModel


class validation(BaseModel):
    prompt: str 


app = FastAPI()

@app.post('/rag')
async def retrival(item: validation):
    rag = vector_search(item.prompt)
    completion = cohere_completion_with_vector_search(item.prompt, rag)

    return completion