hadadrjt commited on
Commit
e4b4a36
·
1 Parent(s): b0a47ca

ai: Enable reasoning for supported models.

Browse files
Files changed (1) hide show
  1. jarvis.py +7 -2
jarvis.py CHANGED
@@ -219,8 +219,13 @@ async def fetch_response_stream_async(host, key, model, msgs, cfg, sid, stop_eve
219
  j = json.loads(data)
220
  if isinstance(j, dict) and j.get("choices"):
221
  ch = j["choices"][0]
222
- if ch.get("delta") and isinstance(ch["delta"].get("content"), str):
223
- yield ch["delta"]["content"]
 
 
 
 
 
224
  except:
225
  continue
226
  except:
 
219
  j = json.loads(data)
220
  if isinstance(j, dict) and j.get("choices"):
221
  ch = j["choices"][0]
222
+ delta = ch.get("delta", {})
223
+ reasoning = delta.get("reasoning")
224
+ content = delta.get("content")
225
+ if reasoning:
226
+ yield reasoning
227
+ if content:
228
+ yield content
229
  except:
230
  continue
231
  except: