llmist 15.14.0 → 15.14.2

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.cjs CHANGED
@@ -5669,11 +5669,12 @@ var init_anthropic = __esm({
5669
5669
  });
5670
5670
 
5671
5671
  // src/providers/gemini-cache-manager.ts
5672
- var import_node_crypto3, GeminiCacheManager;
5672
+ var import_node_crypto3, import_genai, GeminiCacheManager;
5673
5673
  var init_gemini_cache_manager = __esm({
5674
5674
  "src/providers/gemini-cache-manager.ts"() {
5675
5675
  "use strict";
5676
5676
  import_node_crypto3 = require("crypto");
5677
+ import_genai = require("@google/genai");
5677
5678
  GeminiCacheManager = class {
5678
5679
  constructor(client) {
5679
5680
  this.client = client;
@@ -5718,7 +5719,12 @@ var init_gemini_cache_manager = __esm({
5718
5719
  config: {
5719
5720
  contents: cacheableContents,
5720
5721
  ttl,
5721
- displayName: `llmist-${scope}-${Date.now()}`
5722
+ displayName: `llmist-${scope}-${Date.now()}`,
5723
+ toolConfig: {
5724
+ functionCallingConfig: {
5725
+ mode: import_genai.FunctionCallingConfigMode.NONE
5726
+ }
5727
+ }
5722
5728
  }
5723
5729
  });
5724
5730
  if (!response.name) {
@@ -6359,9 +6365,10 @@ function resolveGeminiThinkingConfig(reasoning, modelName) {
6359
6365
  if (!reasoning?.enabled) return void 0;
6360
6366
  const isGemini3 = modelName.includes("gemini-3");
6361
6367
  if (isGemini3) {
6368
+ const levelMap = modelName.includes("pro") ? GEMINI3_PRO_THINKING_LEVEL : GEMINI3_FLASH_THINKING_LEVEL;
6362
6369
  return {
6363
6370
  thinkingConfig: {
6364
- thinkingLevel: GEMINI3_THINKING_LEVEL[reasoning.effort ?? "medium"]
6371
+ thinkingLevel: levelMap[reasoning.effort ?? "medium"]
6365
6372
  }
6366
6373
  };
6367
6374
  }
@@ -6398,13 +6405,13 @@ function wrapPcmInWav(pcmData, sampleRate, bitsPerSample, numChannels) {
6398
6405
  return buffer;
6399
6406
  }
6400
6407
  function createGeminiProviderFromEnv() {
6401
- return createProviderFromEnv("GEMINI_API_KEY", import_genai.GoogleGenAI, GeminiGenerativeProvider);
6408
+ return createProviderFromEnv("GEMINI_API_KEY", import_genai2.GoogleGenAI, GeminiGenerativeProvider);
6402
6409
  }
6403
- var import_genai, GEMINI3_THINKING_LEVEL, GEMINI25_THINKING_BUDGET, GEMINI_ROLE_MAP, GeminiGenerativeProvider;
6410
+ var import_genai2, GEMINI3_PRO_THINKING_LEVEL, GEMINI3_FLASH_THINKING_LEVEL, GEMINI25_THINKING_BUDGET, GEMINI_ROLE_MAP, GeminiGenerativeProvider;
6404
6411
  var init_gemini = __esm({
6405
6412
  "src/providers/gemini.ts"() {
6406
6413
  "use strict";
6407
- import_genai = require("@google/genai");
6414
+ import_genai2 = require("@google/genai");
6408
6415
  init_messages();
6409
6416
  init_base_provider();
6410
6417
  init_constants2();
@@ -6413,7 +6420,14 @@ var init_gemini = __esm({
6413
6420
  init_gemini_models();
6414
6421
  init_gemini_speech_models();
6415
6422
  init_utils();
6416
- GEMINI3_THINKING_LEVEL = {
6423
+ GEMINI3_PRO_THINKING_LEVEL = {
6424
+ none: "low",
6425
+ low: "low",
6426
+ medium: "high",
6427
+ high: "high",
6428
+ maximum: "high"
6429
+ };
6430
+ GEMINI3_FLASH_THINKING_LEVEL = {
6417
6431
  none: "minimal",
6418
6432
  low: "low",
6419
6433
  medium: "medium",
@@ -6535,7 +6549,7 @@ var init_gemini = __esm({
6535
6549
  model: options.model,
6536
6550
  contents: [{ role: "user", parts: [{ text: options.prompt }] }],
6537
6551
  config: {
6538
- responseModalities: [import_genai.Modality.IMAGE, import_genai.Modality.TEXT]
6552
+ responseModalities: [import_genai2.Modality.IMAGE, import_genai2.Modality.TEXT]
6539
6553
  }
6540
6554
  });
6541
6555
  const images = [];
@@ -6583,7 +6597,7 @@ var init_gemini = __esm({
6583
6597
  }
6584
6598
  ],
6585
6599
  config: {
6586
- responseModalities: [import_genai.Modality.AUDIO],
6600
+ responseModalities: [import_genai2.Modality.AUDIO],
6587
6601
  speechConfig: {
6588
6602
  voiceConfig: {
6589
6603
  prebuiltVoiceConfig: {
@@ -6642,15 +6656,16 @@ var init_gemini = __esm({
6642
6656
  // Note: systemInstruction removed - it doesn't work with countTokens()
6643
6657
  // System messages are now included in contents as user+model exchanges
6644
6658
  ...generationConfig ? { ...generationConfig } : {},
6645
- // Explicitly disable function calling to prevent UNEXPECTED_TOOL_CALL errors
6646
- toolConfig: {
6647
- functionCallingConfig: {
6648
- mode: import_genai.FunctionCallingConfigMode.NONE
6659
+ // When using cached content, toolConfig lives inside the cache resource.
6660
+ // Gemini rejects requests that include both cachedContent and toolConfig.
6661
+ ...cacheName ? { cachedContent: cacheName } : {
6662
+ toolConfig: {
6663
+ functionCallingConfig: {
6664
+ mode: import_genai2.FunctionCallingConfigMode.NONE
6665
+ }
6649
6666
  }
6650
6667
  },
6651
6668
  ...thinkingConfig ?? {},
6652
- // Add cache reference if available
6653
- ...cacheName ? { cachedContent: cacheName } : {},
6654
6669
  ...options.extra
6655
6670
  };
6656
6671
  return {