agent-mp 0.4.13 → 0.4.15
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/dist/commands/repl.js
CHANGED
package/dist/commands/setup.js
CHANGED
package/dist/utils/qwen-auth.js
CHANGED
|
@@ -259,7 +259,7 @@ async function callQwenAPIWithToken(token, prompt, model, onData) {
|
|
|
259
259
|
const baseUrl = host.endsWith('/v1') ? host : `${host}/v1`;
|
|
260
260
|
const useStream = !!onData;
|
|
261
261
|
const userAgent = `QwenCode/0.14.2 (${process.platform}; ${process.arch})`;
|
|
262
|
-
// portal.qwen.ai requires content parts format (plain strings
|
|
262
|
+
// portal.qwen.ai requires: content parts format + system message (plain strings → 400, no system → 400)
|
|
263
263
|
const toContentParts = (text) => [{ type: 'text', text }];
|
|
264
264
|
const response = await fetch(`${baseUrl}/chat/completions`, {
|
|
265
265
|
method: 'POST',
|
|
@@ -281,7 +281,10 @@ async function callQwenAPIWithToken(token, prompt, model, onData) {
|
|
|
281
281
|
},
|
|
282
282
|
body: JSON.stringify({
|
|
283
283
|
model: model || 'coder-model',
|
|
284
|
-
messages: [
|
|
284
|
+
messages: [
|
|
285
|
+
{ role: 'system', content: toContentParts('You are a helpful coding assistant.') },
|
|
286
|
+
{ role: 'user', content: toContentParts(prompt) },
|
|
287
|
+
],
|
|
285
288
|
stream: useStream,
|
|
286
289
|
}),
|
|
287
290
|
});
|