@browser-ai/web-llm 2.1.5 → 2.1.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/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1417,10 +1417,12 @@ var WebLLMLanguageModel = class {
|
|
|
1417
1417
|
top_p: topP,
|
|
1418
1418
|
seed
|
|
1419
1419
|
};
|
|
1420
|
-
|
|
1420
|
+
const webLLMOptions = providerOptions?.[this.provider];
|
|
1421
|
+
const extraBody = webLLMOptions?.extra_body;
|
|
1422
|
+
if (extraBody) {
|
|
1421
1423
|
requestOptions.extra_body = {
|
|
1422
|
-
enable_thinking:
|
|
1423
|
-
enable_latency_breakdown:
|
|
1424
|
+
enable_thinking: extraBody.enable_thinking,
|
|
1425
|
+
enable_latency_breakdown: extraBody.enable_latency_breakdown
|
|
1424
1426
|
};
|
|
1425
1427
|
}
|
|
1426
1428
|
if (responseFormat?.type === "json") {
|
|
@@ -1516,7 +1518,7 @@ var WebLLMLanguageModel = class {
|
|
|
1516
1518
|
reasoning: void 0
|
|
1517
1519
|
}
|
|
1518
1520
|
},
|
|
1519
|
-
request: { body: { messages: promptMessages
|
|
1521
|
+
request: { body: { ...requestOptions, messages: promptMessages } },
|
|
1520
1522
|
warnings
|
|
1521
1523
|
};
|
|
1522
1524
|
}
|
|
@@ -1552,7 +1554,7 @@ var WebLLMLanguageModel = class {
|
|
|
1552
1554
|
total: response.usage?.total_tokens
|
|
1553
1555
|
}
|
|
1554
1556
|
},
|
|
1555
|
-
request: { body: { messages: promptMessages
|
|
1557
|
+
request: { body: { ...requestOptions, messages: promptMessages } },
|
|
1556
1558
|
warnings
|
|
1557
1559
|
};
|
|
1558
1560
|
} catch (error) {
|
|
@@ -1742,7 +1744,7 @@ var WebLLMLanguageModel = class {
|
|
|
1742
1744
|
});
|
|
1743
1745
|
return {
|
|
1744
1746
|
stream,
|
|
1745
|
-
request: { body: { messages: promptMessages
|
|
1747
|
+
request: { body: { ...requestOptions, messages: promptMessages } }
|
|
1746
1748
|
};
|
|
1747
1749
|
}
|
|
1748
1750
|
};
|