Update app.py
Browse files
app.py
CHANGED
@@ -498,7 +498,7 @@ def handsome_chat_completions():
|
|
498 |
}]
|
499 |
}
|
500 |
|
501 |
-
if "reasoning_content"
|
502 |
if first_reasoning_chunk:
|
503 |
openai_chunk["choices"][0]["delta"]["content"] = "<think>\n"
|
504 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
@@ -508,7 +508,7 @@ def handsome_chat_completions():
|
|
508 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
509 |
reasoning_content_accumulated += delta["reasoning_content"]
|
510 |
|
511 |
-
if "content"
|
512 |
if not first_reasoning_chunk:
|
513 |
openai_chunk["choices"][0]["delta"]["content"] = "\n</think>\n"
|
514 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
|
|
498 |
}]
|
499 |
}
|
500 |
|
501 |
+
if delta.get("reasoning_content") is not None:
|
502 |
if first_reasoning_chunk:
|
503 |
openai_chunk["choices"][0]["delta"]["content"] = "<think>\n"
|
504 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
|
|
508 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
509 |
reasoning_content_accumulated += delta["reasoning_content"]
|
510 |
|
511 |
+
if delta.get("content") is not None:
|
512 |
if not first_reasoning_chunk:
|
513 |
openai_chunk["choices"][0]["delta"]["content"] = "\n</think>\n"
|
514 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|