File size: 467 Bytes
1e2a35a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2d7f158
 
1e2a35a
 
 
cd09fba
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import uvicorn
from fastapi import FastAPI
from pydantic import BaseModel
from model import get_answer_from_llm


class Prompt(BaseModel):
    prompt: str = ''


app = FastAPI(
    title='CommandRLLMAPI'
)


@app.post("/completion/")
async def get_answer(question: Prompt):
    answer = await get_answer_from_llm(question.prompt)
    return answer


# if __name__ == '__main__':
#     uvicorn.run(
#         app,
#         host='0.0.0.0',
#         port=8081
#     )