ai: Enable reasoning for supported models.
Browse files
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 |
-
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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:
|