@ax-llm/ax 11.0.31 → 11.0.32

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/index.d.cts CHANGED
@@ -904,6 +904,7 @@ declare class AxAIDeepSeek extends AxAIOpenAIBase<AxAIDeepSeekModel, undefined>
904
904
  }
905
905
 
906
906
  declare enum AxAIGoogleGeminiModel {
907
+ Gemini25Pro = "gemini-2.5-pro-exp-03-25",
907
908
  Gemini20Pro = "gemini-2.0-pro-exp-02-05",
908
909
  Gemini20Flash = "gemini-2.0-flash",
909
910
  Gemini20FlashLite = "gemini-2.0-flash-lite-preview-02-05",
@@ -912,12 +913,11 @@ declare enum AxAIGoogleGeminiModel {
912
913
  Gemini15Flash = "gemini-1.5-flash",
913
914
  Gemini15Flash002 = "gemini-1.5-flash-002",
914
915
  Gemini15Flash8B = "gemini-1.5-flash-8b",
915
- Gemini15Pro = "gemini-1.5-pro",
916
- Gemma2 = "gemma-2-27b-it",
917
- AQA = "aqa"
916
+ Gemini15Pro = "gemini-1.5-pro"
918
917
  }
919
918
  declare enum AxAIGoogleGeminiEmbedModel {
920
919
  GeminiEmbedding = "gemini-embedding-exp-03-07",
920
+ TextEmbeddingLarge = "text-embedding-large-exp-03-07",
921
921
  TextEmbedding004 = "text-embedding-004",
922
922
  TextEmbedding005 = "text-embedding-005"
923
923
  }
@@ -1055,6 +1055,7 @@ type AxAIGoogleGeminiConfig = AxModelConfig & {
1055
1055
  safetySettings?: AxAIGoogleGeminiSafetySettings;
1056
1056
  embedType?: AxAIGoogleGeminiEmbedTypes;
1057
1057
  dimensions?: number;
1058
+ autoTruncate?: boolean;
1058
1059
  };
1059
1060
  /**
1060
1061
  * AxAIGoogleGeminiEmbedRequest: Structure for making an embedding request to the Google Gemini API.
@@ -1083,7 +1084,12 @@ type AxAIGoogleGeminiBatchEmbedResponse = {
1083
1084
  type AxAIGoogleVertexBatchEmbedRequest = {
1084
1085
  instances: {
1085
1086
  content: string;
1087
+ task_type?: AxAIGoogleGeminiEmbedTypes;
1086
1088
  }[];
1089
+ parameters: {
1090
+ autoTruncate?: boolean;
1091
+ outputDimensionality?: number;
1092
+ };
1087
1093
  };
1088
1094
  /**
1089
1095
  * AxAIGoogleVertexBatchEmbedResponse: Structure for handling responses from the Google Vertex API embedding requests.
package/index.d.ts CHANGED
@@ -904,6 +904,7 @@ declare class AxAIDeepSeek extends AxAIOpenAIBase<AxAIDeepSeekModel, undefined>
904
904
  }
905
905
 
906
906
  declare enum AxAIGoogleGeminiModel {
907
+ Gemini25Pro = "gemini-2.5-pro-exp-03-25",
907
908
  Gemini20Pro = "gemini-2.0-pro-exp-02-05",
908
909
  Gemini20Flash = "gemini-2.0-flash",
909
910
  Gemini20FlashLite = "gemini-2.0-flash-lite-preview-02-05",
@@ -912,12 +913,11 @@ declare enum AxAIGoogleGeminiModel {
912
913
  Gemini15Flash = "gemini-1.5-flash",
913
914
  Gemini15Flash002 = "gemini-1.5-flash-002",
914
915
  Gemini15Flash8B = "gemini-1.5-flash-8b",
915
- Gemini15Pro = "gemini-1.5-pro",
916
- Gemma2 = "gemma-2-27b-it",
917
- AQA = "aqa"
916
+ Gemini15Pro = "gemini-1.5-pro"
918
917
  }
919
918
  declare enum AxAIGoogleGeminiEmbedModel {
920
919
  GeminiEmbedding = "gemini-embedding-exp-03-07",
920
+ TextEmbeddingLarge = "text-embedding-large-exp-03-07",
921
921
  TextEmbedding004 = "text-embedding-004",
922
922
  TextEmbedding005 = "text-embedding-005"
923
923
  }
@@ -1055,6 +1055,7 @@ type AxAIGoogleGeminiConfig = AxModelConfig & {
1055
1055
  safetySettings?: AxAIGoogleGeminiSafetySettings;
1056
1056
  embedType?: AxAIGoogleGeminiEmbedTypes;
1057
1057
  dimensions?: number;
1058
+ autoTruncate?: boolean;
1058
1059
  };
1059
1060
  /**
1060
1061
  * AxAIGoogleGeminiEmbedRequest: Structure for making an embedding request to the Google Gemini API.
@@ -1083,7 +1084,12 @@ type AxAIGoogleGeminiBatchEmbedResponse = {
1083
1084
  type AxAIGoogleVertexBatchEmbedRequest = {
1084
1085
  instances: {
1085
1086
  content: string;
1087
+ task_type?: AxAIGoogleGeminiEmbedTypes;
1086
1088
  }[];
1089
+ parameters: {
1090
+ autoTruncate?: boolean;
1091
+ outputDimensionality?: number;
1092
+ };
1087
1093
  };
1088
1094
  /**
1089
1095
  * AxAIGoogleVertexBatchEmbedResponse: Structure for handling responses from the Google Vertex API embedding requests.
package/index.js CHANGED
@@ -2503,6 +2503,7 @@ var AxAIDeepSeek = class extends AxAIOpenAIBase {
2503
2503
 
2504
2504
  // ai/google-gemini/types.ts
2505
2505
  var AxAIGoogleGeminiModel = /* @__PURE__ */ ((AxAIGoogleGeminiModel2) => {
2506
+ AxAIGoogleGeminiModel2["Gemini25Pro"] = "gemini-2.5-pro-exp-03-25";
2506
2507
  AxAIGoogleGeminiModel2["Gemini20Pro"] = "gemini-2.0-pro-exp-02-05";
2507
2508
  AxAIGoogleGeminiModel2["Gemini20Flash"] = "gemini-2.0-flash";
2508
2509
  AxAIGoogleGeminiModel2["Gemini20FlashLite"] = "gemini-2.0-flash-lite-preview-02-05";
@@ -2512,12 +2513,11 @@ var AxAIGoogleGeminiModel = /* @__PURE__ */ ((AxAIGoogleGeminiModel2) => {
2512
2513
  AxAIGoogleGeminiModel2["Gemini15Flash002"] = "gemini-1.5-flash-002";
2513
2514
  AxAIGoogleGeminiModel2["Gemini15Flash8B"] = "gemini-1.5-flash-8b";
2514
2515
  AxAIGoogleGeminiModel2["Gemini15Pro"] = "gemini-1.5-pro";
2515
- AxAIGoogleGeminiModel2["Gemma2"] = "gemma-2-27b-it";
2516
- AxAIGoogleGeminiModel2["AQA"] = "aqa";
2517
2516
  return AxAIGoogleGeminiModel2;
2518
2517
  })(AxAIGoogleGeminiModel || {});
2519
2518
  var AxAIGoogleGeminiEmbedModel = /* @__PURE__ */ ((AxAIGoogleGeminiEmbedModel2) => {
2520
2519
  AxAIGoogleGeminiEmbedModel2["GeminiEmbedding"] = "gemini-embedding-exp-03-07";
2520
+ AxAIGoogleGeminiEmbedModel2["TextEmbeddingLarge"] = "text-embedding-large-exp-03-07";
2521
2521
  AxAIGoogleGeminiEmbedModel2["TextEmbedding004"] = "text-embedding-004";
2522
2522
  AxAIGoogleGeminiEmbedModel2["TextEmbedding005"] = "text-embedding-005";
2523
2523
  return AxAIGoogleGeminiEmbedModel2;
@@ -2647,6 +2647,9 @@ var AxAIGoogleGeminiImpl = class {
2647
2647
  this.endpointId = endpointId;
2648
2648
  this.apiKey = apiKey;
2649
2649
  this.options = options;
2650
+ if (!this.isVertex && this.config.autoTruncate) {
2651
+ throw new Error("Auto truncate is not supported for GoogleGemini");
2652
+ }
2650
2653
  }
2651
2654
  getModelConfig() {
2652
2655
  const { config } = this;
@@ -2842,8 +2845,13 @@ var AxAIGoogleGeminiImpl = class {
2842
2845
  }
2843
2846
  reqValue = {
2844
2847
  instances: req.texts.map((text) => ({
2845
- content: text
2846
- }))
2848
+ content: text,
2849
+ ...this.config.embedType && { taskType: this.config.embedType }
2850
+ })),
2851
+ parameters: {
2852
+ autoTruncate: this.config.autoTruncate,
2853
+ outputDimensionality: this.config.dimensions
2854
+ }
2847
2855
  };
2848
2856
  } else {
2849
2857
  apiConfig = {
@@ -2854,7 +2862,7 @@ var AxAIGoogleGeminiImpl = class {
2854
2862
  model: "models/" + model,
2855
2863
  content: { parts: [{ text }] },
2856
2864
  outputDimensionality: this.config.dimensions,
2857
- taskType: this.config.embedType
2865
+ ...this.config.embedType && { taskType: this.config.embedType }
2858
2866
  }))
2859
2867
  };
2860
2868
  }