Adarshu07 commited on
Commit
bba37f3
·
verified ·
1 Parent(s): 966dc21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -623,14 +623,14 @@ async def _stream_gen(
623
  ):
624
  for kind, text in parser.feed(token):
625
  if kind == "reasoning":
626
- yield _chunk({"reasoning_content": text})
627
  else:
628
  yield _chunk({"content": text})
629
 
630
  # ── flush parser buffer ───────────────────────
631
  for kind, text in parser.flush():
632
  if kind == "reasoning":
633
- yield _chunk({"reasoning_content": text})
634
  else:
635
  yield _chunk({"content": text})
636
 
@@ -680,9 +680,9 @@ async def _complete(
680
  "content": "".join(content),
681
  }
682
  if reasoning:
683
- msg["reasoning_content"] = "".join(reasoning)
684
 
685
- total_chars = len(msg["content"]) + len(msg.get("reasoning_content", ""))
686
 
687
  return {
688
  "id": _cid(),
 
623
  ):
624
  for kind, text in parser.feed(token):
625
  if kind == "reasoning":
626
+ yield _chunk({"reasoning": text})
627
  else:
628
  yield _chunk({"content": text})
629
 
630
  # ── flush parser buffer ───────────────────────
631
  for kind, text in parser.flush():
632
  if kind == "reasoning":
633
+ yield _chunk({"reasoning": text})
634
  else:
635
  yield _chunk({"content": text})
636
 
 
680
  "content": "".join(content),
681
  }
682
  if reasoning:
683
+ msg["reasoning"] = "".join(reasoning)
684
 
685
+ total_chars = len(msg["content"]) + len(msg.get("reasoning", ""))
686
 
687
  return {
688
  "id": _cid(),