Update app.py
Browse files
app.py
CHANGED
@@ -501,24 +501,24 @@ def handsome_chat_completions():
|
|
501 |
if delta.get("reasoning_content") is not None:
|
502 |
if first_reasoning_chunk:
|
503 |
openai_chunk["choices"][0]["delta"]["content"] = "<think>\n"
|
504 |
-
openai_chunk["choices"][0]["delta"]["reasoning_content"] =
|
505 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
506 |
first_reasoning_chunk = False
|
507 |
|
508 |
openai_chunk["choices"][0]["delta"]["content"] = delta["reasoning_content"]
|
509 |
-
openai_chunk["choices"][0]["delta"]["reasoning_content"] =
|
510 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
511 |
reasoning_content_accumulated += delta["reasoning_content"]
|
512 |
|
513 |
if delta.get("content") is not None:
|
514 |
if not first_reasoning_chunk:
|
515 |
openai_chunk["choices"][0]["delta"]["content"] = "\n</think>\n"
|
516 |
-
openai_chunk["choices"][0]["delta"]["reasoning_content"] =
|
517 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
518 |
first_reasoning_chunk = True
|
519 |
|
520 |
openai_chunk["choices"][0]["delta"]["content"] = delta["content"]
|
521 |
-
openai_chunk["choices"][0]["delta"]["reasoning_content"] =
|
522 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
523 |
content_accumulated += delta["content"]
|
524 |
|
|
|
501 |
if delta.get("reasoning_content") is not None:
|
502 |
if first_reasoning_chunk:
|
503 |
openai_chunk["choices"][0]["delta"]["content"] = "<think>\n"
|
504 |
+
openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
|
505 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
506 |
first_reasoning_chunk = False
|
507 |
|
508 |
openai_chunk["choices"][0]["delta"]["content"] = delta["reasoning_content"]
|
509 |
+
openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
|
510 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
511 |
reasoning_content_accumulated += delta["reasoning_content"]
|
512 |
|
513 |
if delta.get("content") is not None:
|
514 |
if not first_reasoning_chunk:
|
515 |
openai_chunk["choices"][0]["delta"]["content"] = "\n</think>\n"
|
516 |
+
openai_chunk["choices"][0]["delta"]["reasoning_content"] = null
|
517 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
518 |
first_reasoning_chunk = True
|
519 |
|
520 |
openai_chunk["choices"][0]["delta"]["content"] = delta["content"]
|
521 |
+
openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
|
522 |
yield f"data: {json.dumps(openai_chunk)}\n\n"
|
523 |
content_accumulated += delta["content"]
|
524 |
|