@jaypie/llm 1.2.27 → 1.2.28
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/cjs/index.cjs +4 -6
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +4 -6
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -1762,8 +1762,6 @@ class GeminiAdapter extends BaseProviderAdapter {
|
|
|
1762
1762
|
contents: geminiRequest.contents,
|
|
1763
1763
|
config: geminiRequest.config,
|
|
1764
1764
|
});
|
|
1765
|
-
// Track current function call being built
|
|
1766
|
-
let currentFunctionCall = null;
|
|
1767
1765
|
// Track usage for final chunk
|
|
1768
1766
|
let inputTokens = 0;
|
|
1769
1767
|
let outputTokens = 0;
|
|
@@ -1784,7 +1782,7 @@ class GeminiAdapter extends BaseProviderAdapter {
|
|
|
1784
1782
|
// Handle function calls
|
|
1785
1783
|
if (part.functionCall) {
|
|
1786
1784
|
const functionCall = part.functionCall;
|
|
1787
|
-
currentFunctionCall = {
|
|
1785
|
+
const currentFunctionCall = {
|
|
1788
1786
|
id: functionCall.id || this.generateCallId(),
|
|
1789
1787
|
name: functionCall.name || "",
|
|
1790
1788
|
arguments: functionCall.args || {},
|
|
@@ -1804,7 +1802,6 @@ class GeminiAdapter extends BaseProviderAdapter {
|
|
|
1804
1802
|
metadata,
|
|
1805
1803
|
},
|
|
1806
1804
|
};
|
|
1807
|
-
currentFunctionCall = null;
|
|
1808
1805
|
}
|
|
1809
1806
|
}
|
|
1810
1807
|
}
|
|
@@ -5394,14 +5391,13 @@ function formatUserMessage$2(message, { data, placeholders } = {}) {
|
|
|
5394
5391
|
function prepareMessages$2(message, { data, placeholders } = {}) {
|
|
5395
5392
|
const logger = getLogger$3();
|
|
5396
5393
|
const messages = [];
|
|
5397
|
-
let systemInstruction;
|
|
5398
5394
|
// Note: Gemini handles system prompts differently via systemInstruction config
|
|
5399
5395
|
// This function is kept for compatibility but system prompts should be passed
|
|
5400
5396
|
// via the systemInstruction parameter in generateContent
|
|
5401
5397
|
const userMessage = formatUserMessage$2(message, { data, placeholders });
|
|
5402
5398
|
messages.push(userMessage);
|
|
5403
5399
|
logger.trace(`User message: ${userMessage.content?.length} characters`);
|
|
5404
|
-
return { messages, systemInstruction };
|
|
5400
|
+
return { messages, systemInstruction: undefined };
|
|
5405
5401
|
}
|
|
5406
5402
|
|
|
5407
5403
|
class GeminiProvider {
|
|
@@ -6424,8 +6420,10 @@ const weather = {
|
|
|
6424
6420
|
}
|
|
6425
6421
|
catch (error) {
|
|
6426
6422
|
if (error instanceof Error) {
|
|
6423
|
+
// eslint-disable-next-line preserve-caught-error -- package targets ES2020; Error `cause` option requires ES2022
|
|
6427
6424
|
throw new Error(`Weather API error: ${error.message}`);
|
|
6428
6425
|
}
|
|
6426
|
+
// eslint-disable-next-line preserve-caught-error -- package targets ES2020; Error `cause` option requires ES2022
|
|
6429
6427
|
throw new Error("Unknown error occurred while fetching weather data");
|
|
6430
6428
|
}
|
|
6431
6429
|
},
|