Spaces:
Sleeping
Sleeping
Update routes/chatCompletion.py
Browse files- 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):
|