eienmojiki commited on
Commit
fbbf18e
·
verified ·
1 Parent(s): 9d69044

Update routes/chatCompletion.py

Browse files
Files changed (1) hide show
  1. routes/chatCompletion.py +1 -0
routes/chatCompletion.py CHANGED
@@ -9,6 +9,7 @@ router = APIRouter()
9
  def generate_stream(response):
10
  for chunk in response:
11
  yield f"data: {json.dumps(chunk.__dict__, separators=(',', ':'))}\n\n"
 
12
 
13
  @router.post("/v1/chat/completions", tags=["Chat Completion"])
14
  async def chat_completion(body: ChatRequest):
 
9
  def generate_stream(response):
10
  for chunk in response:
11
  yield f"data: {json.dumps(chunk.__dict__, separators=(',', ':'))}\n\n"
12
+ yield "data: [DONE]\n\n"
13
 
14
  @router.post("/v1/chat/completions", tags=["Chat Completion"])
15
  async def chat_completion(body: ChatRequest):