Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
milesha committed Oct 1, 2024
1 parent 955cbeb commit 987e08e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/intelligence-service/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@

app = FastAPI()


class ChatRequest(BaseModel):
message: str


class ChatResponse(BaseModel):
response: str


@app.post("/chat", response_model=ChatResponse, summary="Chat with LLM")
async def chat(request: ChatRequest):
try:
response = model.invoke(request.message)
return { "response": response.content }
return {"response": response.content}
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
raise HTTPException(status_code=500, detail=str(e))

0 comments on commit 987e08e

Please sign in to comment.