MarcoLeung052 commited on
Commit
eb06e34
·
verified ·
1 Parent(s): f03486f

Update api_server.py

Browse files
Files changed (1) hide show
  1. api_server.py +3 -2
api_server.py CHANGED
@@ -4,6 +4,8 @@ from fastapi import FastAPI, HTTPException, Depends
4
  from fastapi.middleware.cors import CORSMiddleware
5
  from pydantic import BaseModel
6
  from backend.agent import run_agent
 
 
7
 
8
  app = FastAPI(title="Nursing Copilot API")
9
 
@@ -30,8 +32,7 @@ class PredictionRequest(BaseModel):
30
  model: str | None = "gpt2-nursing"
31
 
32
  class PredictionResponse(BaseModel):
33
- completions: list[str]
34
-
35
 
36
  # -----------------------------
37
  # API Endpoint
 
4
  from fastapi.middleware.cors import CORSMiddleware
5
  from pydantic import BaseModel
6
  from backend.agent import run_agent
7
+ from typing import Union
8
+
9
 
10
  app = FastAPI(title="Nursing Copilot API")
11
 
 
32
  model: str | None = "gpt2-nursing"
33
 
34
  class PredictionResponse(BaseModel):
35
+ completions: list[Union[str, dict]]
 
36
 
37
  # -----------------------------
38
  # API Endpoint