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