@ax-llm/ax 16.0.5 → 16.0.7
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 +82 -82
- package/index.cjs.map +1 -1
- package/index.d.cts +22 -8
- package/index.d.ts +22 -8
- package/index.global.js +83 -83
- package/index.global.js.map +1 -1
- package/index.js +85 -85
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -680,6 +680,16 @@ type AxAIServiceOptions = {
|
|
|
680
680
|
* Currently supported by: Google Gemini/Vertex AI
|
|
681
681
|
*/
|
|
682
682
|
contextCache?: AxContextCacheOptions;
|
|
683
|
+
/**
|
|
684
|
+
* When true, examples/demos are embedded in system prompt (legacy).
|
|
685
|
+
* When false (default), they are rendered as alternating user/assistant message pairs.
|
|
686
|
+
*/
|
|
687
|
+
examplesInSystem?: boolean;
|
|
688
|
+
/**
|
|
689
|
+
* Custom labels to include in OpenTelemetry metrics.
|
|
690
|
+
* These labels are merged with axGlobals.customLabels (service-level overrides global).
|
|
691
|
+
*/
|
|
692
|
+
customLabels?: Record<string, string>;
|
|
683
693
|
};
|
|
684
694
|
interface AxAIService<TModel = unknown, TEmbedModel = unknown, TModelKey = string> {
|
|
685
695
|
getId(): string;
|
|
@@ -2055,6 +2065,7 @@ declare class AxGen<IN = any, OUT extends AxGenOut = any> extends AxProgram<IN,
|
|
|
2055
2065
|
getInstruction(): string | undefined;
|
|
2056
2066
|
private getSignatureName;
|
|
2057
2067
|
private getMetricsInstruments;
|
|
2068
|
+
private getMergedCustomLabels;
|
|
2058
2069
|
updateMeter(meter?: Meter): void;
|
|
2059
2070
|
private createStates;
|
|
2060
2071
|
addAssert: (fn: AxAssertion<OUT>["fn"], message?: string) => void;
|
|
@@ -2662,6 +2673,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
|
|
|
2662
2673
|
private logger;
|
|
2663
2674
|
private corsProxy?;
|
|
2664
2675
|
private retry?;
|
|
2676
|
+
private customLabels?;
|
|
2665
2677
|
private modelInfo;
|
|
2666
2678
|
private modelUsage?;
|
|
2667
2679
|
private embedModelUsage?;
|
|
@@ -2685,6 +2697,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
|
|
|
2685
2697
|
setOptions(options: Readonly<AxAIServiceOptions>): void;
|
|
2686
2698
|
getOptions(): Readonly<AxAIServiceOptions>;
|
|
2687
2699
|
getLogger(): AxLoggerFunction;
|
|
2700
|
+
private getMergedCustomLabels;
|
|
2688
2701
|
getModelList(): ({
|
|
2689
2702
|
readonly key: TModelKey;
|
|
2690
2703
|
readonly description: string;
|
|
@@ -2863,15 +2876,10 @@ type AxAIAnthropicChatRequest = {
|
|
|
2863
2876
|
})[];
|
|
2864
2877
|
} | {
|
|
2865
2878
|
role: 'assistant';
|
|
2866
|
-
content: string | ({
|
|
2879
|
+
content: string | (({
|
|
2867
2880
|
type: 'text';
|
|
2868
2881
|
text: string;
|
|
2869
|
-
} | {
|
|
2870
|
-
type: 'tool_use';
|
|
2871
|
-
id: string;
|
|
2872
|
-
name: string;
|
|
2873
|
-
input: object;
|
|
2874
|
-
} | {
|
|
2882
|
+
} & AxAIAnthropicChatRequestCacheParam) | {
|
|
2875
2883
|
type: 'thinking';
|
|
2876
2884
|
thinking: string;
|
|
2877
2885
|
signature?: string;
|
|
@@ -2879,7 +2887,12 @@ type AxAIAnthropicChatRequest = {
|
|
|
2879
2887
|
type: 'redacted_thinking';
|
|
2880
2888
|
data: string;
|
|
2881
2889
|
signature?: string;
|
|
2882
|
-
}
|
|
2890
|
+
} | ({
|
|
2891
|
+
type: 'tool_use';
|
|
2892
|
+
id: string;
|
|
2893
|
+
name: string;
|
|
2894
|
+
input: object;
|
|
2895
|
+
} & AxAIAnthropicChatRequestCacheParam))[];
|
|
2883
2896
|
})[];
|
|
2884
2897
|
tools?: AxAIAnthropicRequestTool[];
|
|
2885
2898
|
tool_choice?: {
|
|
@@ -6138,6 +6151,7 @@ declare const axGlobals: {
|
|
|
6138
6151
|
optimizerLogger: AxOptimizerLoggerFunction | undefined;
|
|
6139
6152
|
debug: boolean | undefined;
|
|
6140
6153
|
abortSignal: AbortSignal | undefined;
|
|
6154
|
+
customLabels: Record<string, string> | undefined;
|
|
6141
6155
|
cachingFunction: ((key: string, value?: AxGenOut) => AxGenOut | undefined | Promise<AxGenOut | undefined>) | undefined;
|
|
6142
6156
|
functionResultFormatter: AxFunctionResultFormatter;
|
|
6143
6157
|
};
|
package/index.d.ts
CHANGED
|
@@ -680,6 +680,16 @@ type AxAIServiceOptions = {
|
|
|
680
680
|
* Currently supported by: Google Gemini/Vertex AI
|
|
681
681
|
*/
|
|
682
682
|
contextCache?: AxContextCacheOptions;
|
|
683
|
+
/**
|
|
684
|
+
* When true, examples/demos are embedded in system prompt (legacy).
|
|
685
|
+
* When false (default), they are rendered as alternating user/assistant message pairs.
|
|
686
|
+
*/
|
|
687
|
+
examplesInSystem?: boolean;
|
|
688
|
+
/**
|
|
689
|
+
* Custom labels to include in OpenTelemetry metrics.
|
|
690
|
+
* These labels are merged with axGlobals.customLabels (service-level overrides global).
|
|
691
|
+
*/
|
|
692
|
+
customLabels?: Record<string, string>;
|
|
683
693
|
};
|
|
684
694
|
interface AxAIService<TModel = unknown, TEmbedModel = unknown, TModelKey = string> {
|
|
685
695
|
getId(): string;
|
|
@@ -2055,6 +2065,7 @@ declare class AxGen<IN = any, OUT extends AxGenOut = any> extends AxProgram<IN,
|
|
|
2055
2065
|
getInstruction(): string | undefined;
|
|
2056
2066
|
private getSignatureName;
|
|
2057
2067
|
private getMetricsInstruments;
|
|
2068
|
+
private getMergedCustomLabels;
|
|
2058
2069
|
updateMeter(meter?: Meter): void;
|
|
2059
2070
|
private createStates;
|
|
2060
2071
|
addAssert: (fn: AxAssertion<OUT>["fn"], message?: string) => void;
|
|
@@ -2662,6 +2673,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
|
|
|
2662
2673
|
private logger;
|
|
2663
2674
|
private corsProxy?;
|
|
2664
2675
|
private retry?;
|
|
2676
|
+
private customLabels?;
|
|
2665
2677
|
private modelInfo;
|
|
2666
2678
|
private modelUsage?;
|
|
2667
2679
|
private embedModelUsage?;
|
|
@@ -2685,6 +2697,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
|
|
|
2685
2697
|
setOptions(options: Readonly<AxAIServiceOptions>): void;
|
|
2686
2698
|
getOptions(): Readonly<AxAIServiceOptions>;
|
|
2687
2699
|
getLogger(): AxLoggerFunction;
|
|
2700
|
+
private getMergedCustomLabels;
|
|
2688
2701
|
getModelList(): ({
|
|
2689
2702
|
readonly key: TModelKey;
|
|
2690
2703
|
readonly description: string;
|
|
@@ -2863,15 +2876,10 @@ type AxAIAnthropicChatRequest = {
|
|
|
2863
2876
|
})[];
|
|
2864
2877
|
} | {
|
|
2865
2878
|
role: 'assistant';
|
|
2866
|
-
content: string | ({
|
|
2879
|
+
content: string | (({
|
|
2867
2880
|
type: 'text';
|
|
2868
2881
|
text: string;
|
|
2869
|
-
} | {
|
|
2870
|
-
type: 'tool_use';
|
|
2871
|
-
id: string;
|
|
2872
|
-
name: string;
|
|
2873
|
-
input: object;
|
|
2874
|
-
} | {
|
|
2882
|
+
} & AxAIAnthropicChatRequestCacheParam) | {
|
|
2875
2883
|
type: 'thinking';
|
|
2876
2884
|
thinking: string;
|
|
2877
2885
|
signature?: string;
|
|
@@ -2879,7 +2887,12 @@ type AxAIAnthropicChatRequest = {
|
|
|
2879
2887
|
type: 'redacted_thinking';
|
|
2880
2888
|
data: string;
|
|
2881
2889
|
signature?: string;
|
|
2882
|
-
}
|
|
2890
|
+
} | ({
|
|
2891
|
+
type: 'tool_use';
|
|
2892
|
+
id: string;
|
|
2893
|
+
name: string;
|
|
2894
|
+
input: object;
|
|
2895
|
+
} & AxAIAnthropicChatRequestCacheParam))[];
|
|
2883
2896
|
})[];
|
|
2884
2897
|
tools?: AxAIAnthropicRequestTool[];
|
|
2885
2898
|
tool_choice?: {
|
|
@@ -6138,6 +6151,7 @@ declare const axGlobals: {
|
|
|
6138
6151
|
optimizerLogger: AxOptimizerLoggerFunction | undefined;
|
|
6139
6152
|
debug: boolean | undefined;
|
|
6140
6153
|
abortSignal: AbortSignal | undefined;
|
|
6154
|
+
customLabels: Record<string, string> | undefined;
|
|
6141
6155
|
cachingFunction: ((key: string, value?: AxGenOut) => AxGenOut | undefined | Promise<AxGenOut | undefined>) | undefined;
|
|
6142
6156
|
functionResultFormatter: AxFunctionResultFormatter;
|
|
6143
6157
|
};
|