@ax-llm/ax 11.0.19 → 11.0.21
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 +10 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -2
- package/index.d.ts +2 -2
- package/index.js +10 -10
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -1066,7 +1066,7 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1066
1066
|
apiKey?: string;
|
|
1067
1067
|
projectId?: string;
|
|
1068
1068
|
region?: string;
|
|
1069
|
-
|
|
1069
|
+
endpointId?: string;
|
|
1070
1070
|
config?: Readonly<Partial<AxAIGoogleGeminiConfig>>;
|
|
1071
1071
|
options?: Readonly<AxAIServiceOptions & AxAIGoogleGeminiOptionsTools>;
|
|
1072
1072
|
models?: AxAIModelList<AxAIGoogleGeminiModel>;
|
|
@@ -1075,7 +1075,7 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1075
1075
|
* AxAIGoogleGemini: AI Service
|
|
1076
1076
|
*/
|
|
1077
1077
|
declare class AxAIGoogleGemini extends AxBaseAI<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiChatRequest, AxAIGoogleGeminiBatchEmbedRequest | AxAIGoogleVertexBatchEmbedRequest, AxAIGoogleGeminiChatResponse, AxAIGoogleGeminiChatResponseDelta, AxAIGoogleGeminiBatchEmbedResponse | AxAIGoogleVertexBatchEmbedResponse> {
|
|
1078
|
-
constructor({ apiKey, projectId, region,
|
|
1078
|
+
constructor({ apiKey, projectId, region, endpointId, config, options, models, }: Readonly<Omit<AxAIGoogleGeminiArgs, 'name'>>);
|
|
1079
1079
|
}
|
|
1080
1080
|
|
|
1081
1081
|
declare enum AxAIGroqModel {
|
package/index.d.ts
CHANGED
|
@@ -1066,7 +1066,7 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1066
1066
|
apiKey?: string;
|
|
1067
1067
|
projectId?: string;
|
|
1068
1068
|
region?: string;
|
|
1069
|
-
|
|
1069
|
+
endpointId?: string;
|
|
1070
1070
|
config?: Readonly<Partial<AxAIGoogleGeminiConfig>>;
|
|
1071
1071
|
options?: Readonly<AxAIServiceOptions & AxAIGoogleGeminiOptionsTools>;
|
|
1072
1072
|
models?: AxAIModelList<AxAIGoogleGeminiModel>;
|
|
@@ -1075,7 +1075,7 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1075
1075
|
* AxAIGoogleGemini: AI Service
|
|
1076
1076
|
*/
|
|
1077
1077
|
declare class AxAIGoogleGemini extends AxBaseAI<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiChatRequest, AxAIGoogleGeminiBatchEmbedRequest | AxAIGoogleVertexBatchEmbedRequest, AxAIGoogleGeminiChatResponse, AxAIGoogleGeminiChatResponseDelta, AxAIGoogleGeminiBatchEmbedResponse | AxAIGoogleVertexBatchEmbedResponse> {
|
|
1078
|
-
constructor({ apiKey, projectId, region,
|
|
1078
|
+
constructor({ apiKey, projectId, region, endpointId, config, options, models, }: Readonly<Omit<AxAIGoogleGeminiArgs, 'name'>>);
|
|
1079
1079
|
}
|
|
1080
1080
|
|
|
1081
1081
|
declare enum AxAIGroqModel {
|
package/index.js
CHANGED
|
@@ -2596,10 +2596,10 @@ var axAIGoogleGeminiDefaultConfig = () => structuredClone({
|
|
|
2596
2596
|
...axBaseAIDefaultConfig()
|
|
2597
2597
|
});
|
|
2598
2598
|
var AxAIGoogleGeminiImpl = class {
|
|
2599
|
-
constructor(config, isVertex,
|
|
2599
|
+
constructor(config, isVertex, endpointId, apiKey, options) {
|
|
2600
2600
|
this.config = config;
|
|
2601
2601
|
this.isVertex = isVertex;
|
|
2602
|
-
this.
|
|
2602
|
+
this.endpointId = endpointId;
|
|
2603
2603
|
this.apiKey = apiKey;
|
|
2604
2604
|
this.options = options;
|
|
2605
2605
|
}
|
|
@@ -2625,9 +2625,9 @@ var AxAIGoogleGeminiImpl = class {
|
|
|
2625
2625
|
throw new Error("Chat prompt is empty");
|
|
2626
2626
|
}
|
|
2627
2627
|
let apiConfig;
|
|
2628
|
-
if (this.
|
|
2628
|
+
if (this.endpointId) {
|
|
2629
2629
|
apiConfig = {
|
|
2630
|
-
name: stream ? `/${this.
|
|
2630
|
+
name: stream ? `/${this.endpointId}:streamGenerateContent?alt=sse` : `/${this.endpointId}:generateContent`
|
|
2631
2631
|
};
|
|
2632
2632
|
} else {
|
|
2633
2633
|
apiConfig = {
|
|
@@ -2786,9 +2786,9 @@ var AxAIGoogleGeminiImpl = class {
|
|
|
2786
2786
|
let apiConfig;
|
|
2787
2787
|
let reqValue;
|
|
2788
2788
|
if (this.isVertex) {
|
|
2789
|
-
if (this.
|
|
2789
|
+
if (this.endpointId) {
|
|
2790
2790
|
apiConfig = {
|
|
2791
|
-
name: `/${this.
|
|
2791
|
+
name: `/${this.endpointId}:predict`
|
|
2792
2792
|
};
|
|
2793
2793
|
} else {
|
|
2794
2794
|
apiConfig = {
|
|
@@ -2892,7 +2892,7 @@ var AxAIGoogleGemini = class extends AxBaseAI {
|
|
|
2892
2892
|
apiKey,
|
|
2893
2893
|
projectId,
|
|
2894
2894
|
region,
|
|
2895
|
-
|
|
2895
|
+
endpointId,
|
|
2896
2896
|
config,
|
|
2897
2897
|
options,
|
|
2898
2898
|
models
|
|
@@ -2902,7 +2902,7 @@ var AxAIGoogleGemini = class extends AxBaseAI {
|
|
|
2902
2902
|
let headers;
|
|
2903
2903
|
if (isVertex) {
|
|
2904
2904
|
let path;
|
|
2905
|
-
if (
|
|
2905
|
+
if (endpointId) {
|
|
2906
2906
|
path = "endpoints";
|
|
2907
2907
|
} else {
|
|
2908
2908
|
path = "publishers/google";
|
|
@@ -2930,7 +2930,7 @@ var AxAIGoogleGemini = class extends AxBaseAI {
|
|
|
2930
2930
|
const aiImpl = new AxAIGoogleGeminiImpl(
|
|
2931
2931
|
_config,
|
|
2932
2932
|
isVertex,
|
|
2933
|
-
|
|
2933
|
+
endpointId,
|
|
2934
2934
|
apiKey,
|
|
2935
2935
|
options
|
|
2936
2936
|
);
|
|
@@ -5180,7 +5180,7 @@ var renderOutputFields = (fields) => {
|
|
|
5180
5180
|
const rows = fields.map((field) => {
|
|
5181
5181
|
const name = field.title;
|
|
5182
5182
|
const type = field.type?.name ? toFieldType(field.type) : "string";
|
|
5183
|
-
const requiredMsg = field.isOptional ? `Only include this ${type} field
|
|
5183
|
+
const requiredMsg = field.isOptional ? `Only include this ${type} field if its value is available` : `This ${type} field must be included`;
|
|
5184
5184
|
const description = field.description ? ` ${formatDescription(field.description)}` : "";
|
|
5185
5185
|
return `${name}: (${requiredMsg})${description}`.trim();
|
|
5186
5186
|
});
|