shiroai 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +6 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -274,9 +274,14 @@ initMessages();
|
|
|
274
274
|
// ===== STREAMING API =====
|
|
275
275
|
function streamChat(msgs, tools) {
|
|
276
276
|
return new Promise((resolve, reject) => {
|
|
277
|
+
// DO inference doesn't allow system messages - convert to user context
|
|
278
|
+
const filteredMsgs = msgs.map(m => {
|
|
279
|
+
if (m.role === 'system') return { role: 'user', content: `[CONTEXT]\n${m.content}` };
|
|
280
|
+
return m;
|
|
281
|
+
});
|
|
277
282
|
const payload = {
|
|
278
283
|
model: MODEL,
|
|
279
|
-
messages:
|
|
284
|
+
messages: filteredMsgs,
|
|
280
285
|
stream: true,
|
|
281
286
|
max_tokens: 8192
|
|
282
287
|
};
|