File size: 396 Bytes
0ac05a0
 
 
 
 
 
da7cb07
0ac05a0
 
 
 
da7cb07
0ac05a0
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastapi import FastAPI
from app.rag import generate_response
from app.classification import classify_text

app = FastAPI()

@post("/rag")
async def rag_endpoint(prompt: str):
    response = generate_response(prompt)
    return {"response": response}

@post("/classification")
async def classification_endpoint(text: str):
    category = classify_text(text)
    return {"category": category}