@ax-llm/ax 11.0.30 → 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.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  AxAIDeepSeekModel: () => AxAIDeepSeekModel,
43
43
  AxAIGoogleGemini: () => AxAIGoogleGemini,
44
44
  AxAIGoogleGeminiEmbedModel: () => AxAIGoogleGeminiEmbedModel,
45
+ AxAIGoogleGeminiEmbedTypes: () => AxAIGoogleGeminiEmbedTypes,
45
46
  AxAIGoogleGeminiModel: () => AxAIGoogleGeminiModel,
46
47
  AxAIGoogleGeminiSafetyCategory: () => AxAIGoogleGeminiSafetyCategory,
47
48
  AxAIGoogleGeminiSafetyThreshold: () => AxAIGoogleGeminiSafetyThreshold,
@@ -1918,10 +1919,9 @@ var axAIOpenAIFastConfig = () => ({
1918
1919
  model: "gpt-4o-mini" /* GPT4OMini */
1919
1920
  });
1920
1921
  var AxAIOpenAIImpl = class {
1921
- constructor(config, streamingUsage, dimensions) {
1922
+ constructor(config, streamingUsage) {
1922
1923
  this.config = config;
1923
1924
  this.streamingUsage = streamingUsage;
1924
- this.dimensions = dimensions;
1925
1925
  }
1926
1926
  getModelConfig() {
1927
1927
  const { config } = this;
@@ -1993,7 +1993,7 @@ var AxAIOpenAIImpl = class {
1993
1993
  const reqValue = {
1994
1994
  model,
1995
1995
  input: req.texts,
1996
- dimensions: this.dimensions
1996
+ dimensions: this.config.dimensions
1997
1997
  };
1998
1998
  return [apiConfig, reqValue];
1999
1999
  }
@@ -2173,8 +2173,7 @@ var AxAIOpenAIBase = class extends AxBaseAI {
2173
2173
  }
2174
2174
  const aiImpl = new AxAIOpenAIImpl(
2175
2175
  config,
2176
- options?.streamingUsage ?? true,
2177
- config.dimensions
2176
+ options?.streamingUsage ?? true
2178
2177
  );
2179
2178
  super(aiImpl, {
2180
2179
  name: "OpenAI",
@@ -2654,6 +2653,7 @@ var AxAIDeepSeek = class extends AxAIOpenAIBase {
2654
2653
 
2655
2654
  // ai/google-gemini/types.ts
2656
2655
  var AxAIGoogleGeminiModel = /* @__PURE__ */ ((AxAIGoogleGeminiModel2) => {
2656
+ AxAIGoogleGeminiModel2["Gemini25Pro"] = "gemini-2.5-pro-exp-03-25";
2657
2657
  AxAIGoogleGeminiModel2["Gemini20Pro"] = "gemini-2.0-pro-exp-02-05";
2658
2658
  AxAIGoogleGeminiModel2["Gemini20Flash"] = "gemini-2.0-flash";
2659
2659
  AxAIGoogleGeminiModel2["Gemini20FlashLite"] = "gemini-2.0-flash-lite-preview-02-05";
@@ -2663,11 +2663,11 @@ var AxAIGoogleGeminiModel = /* @__PURE__ */ ((AxAIGoogleGeminiModel2) => {
2663
2663
  AxAIGoogleGeminiModel2["Gemini15Flash002"] = "gemini-1.5-flash-002";
2664
2664
  AxAIGoogleGeminiModel2["Gemini15Flash8B"] = "gemini-1.5-flash-8b";
2665
2665
  AxAIGoogleGeminiModel2["Gemini15Pro"] = "gemini-1.5-pro";
2666
- AxAIGoogleGeminiModel2["Gemma2"] = "gemma-2-27b-it";
2667
- AxAIGoogleGeminiModel2["AQA"] = "aqa";
2668
2666
  return AxAIGoogleGeminiModel2;
2669
2667
  })(AxAIGoogleGeminiModel || {});
2670
2668
  var AxAIGoogleGeminiEmbedModel = /* @__PURE__ */ ((AxAIGoogleGeminiEmbedModel2) => {
2669
+ AxAIGoogleGeminiEmbedModel2["GeminiEmbedding"] = "gemini-embedding-exp-03-07";
2670
+ AxAIGoogleGeminiEmbedModel2["TextEmbeddingLarge"] = "text-embedding-large-exp-03-07";
2671
2671
  AxAIGoogleGeminiEmbedModel2["TextEmbedding004"] = "text-embedding-004";
2672
2672
  AxAIGoogleGeminiEmbedModel2["TextEmbedding005"] = "text-embedding-005";
2673
2673
  return AxAIGoogleGeminiEmbedModel2;
@@ -2687,6 +2687,17 @@ var AxAIGoogleGeminiSafetyThreshold = /* @__PURE__ */ ((AxAIGoogleGeminiSafetyTh
2687
2687
  AxAIGoogleGeminiSafetyThreshold2["BlockDefault"] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED";
2688
2688
  return AxAIGoogleGeminiSafetyThreshold2;
2689
2689
  })(AxAIGoogleGeminiSafetyThreshold || {});
2690
+ var AxAIGoogleGeminiEmbedTypes = /* @__PURE__ */ ((AxAIGoogleGeminiEmbedTypes2) => {
2691
+ AxAIGoogleGeminiEmbedTypes2["SemanticSimilarity"] = "SEMANTIC_SIMILARITY";
2692
+ AxAIGoogleGeminiEmbedTypes2["Classification"] = "CLASSIFICATION";
2693
+ AxAIGoogleGeminiEmbedTypes2["Clustering"] = "CLUSTERING";
2694
+ AxAIGoogleGeminiEmbedTypes2["RetrievalDocument"] = "RETRIEVAL_DOCUMENT";
2695
+ AxAIGoogleGeminiEmbedTypes2["RetrievalQuery"] = "RETRIEVAL_QUERY";
2696
+ AxAIGoogleGeminiEmbedTypes2["QuestionAnswering"] = "QUESTION_ANSWERING";
2697
+ AxAIGoogleGeminiEmbedTypes2["FactVerification"] = "FACT_VERIFICATION";
2698
+ AxAIGoogleGeminiEmbedTypes2["CodeRetrievalQuery"] = "CODE_RETRIEVAL_QUERY";
2699
+ return AxAIGoogleGeminiEmbedTypes2;
2700
+ })(AxAIGoogleGeminiEmbedTypes || {});
2690
2701
 
2691
2702
  // ai/google-gemini/info.ts
2692
2703
  var axModelInfoGoogleGemini = [
@@ -2786,6 +2797,9 @@ var AxAIGoogleGeminiImpl = class {
2786
2797
  this.endpointId = endpointId;
2787
2798
  this.apiKey = apiKey;
2788
2799
  this.options = options;
2800
+ if (!this.isVertex && this.config.autoTruncate) {
2801
+ throw new Error("Auto truncate is not supported for GoogleGemini");
2802
+ }
2789
2803
  }
2790
2804
  getModelConfig() {
2791
2805
  const { config } = this;
@@ -2981,8 +2995,13 @@ var AxAIGoogleGeminiImpl = class {
2981
2995
  }
2982
2996
  reqValue = {
2983
2997
  instances: req.texts.map((text) => ({
2984
- content: text
2985
- }))
2998
+ content: text,
2999
+ ...this.config.embedType && { taskType: this.config.embedType }
3000
+ })),
3001
+ parameters: {
3002
+ autoTruncate: this.config.autoTruncate,
3003
+ outputDimensionality: this.config.dimensions
3004
+ }
2986
3005
  };
2987
3006
  } else {
2988
3007
  apiConfig = {
@@ -2991,7 +3010,9 @@ var AxAIGoogleGeminiImpl = class {
2991
3010
  reqValue = {
2992
3011
  requests: req.texts.map((text) => ({
2993
3012
  model: "models/" + model,
2994
- content: { parts: [{ text }] }
3013
+ content: { parts: [{ text }] },
3014
+ outputDimensionality: this.config.dimensions,
3015
+ ...this.config.embedType && { taskType: this.config.embedType }
2995
3016
  }))
2996
3017
  };
2997
3018
  }
@@ -11302,6 +11323,7 @@ var AxRAG = class extends AxChainOfThought {
11302
11323
  AxAIDeepSeekModel,
11303
11324
  AxAIGoogleGemini,
11304
11325
  AxAIGoogleGeminiEmbedModel,
11326
+ AxAIGoogleGeminiEmbedTypes,
11305
11327
  AxAIGoogleGeminiModel,
11306
11328
  AxAIGoogleGeminiSafetyCategory,
11307
11329
  AxAIGoogleGeminiSafetyThreshold,