@ax-llm/ax 14.0.39 → 14.0.40
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 +74 -77
- package/index.cjs.map +1 -1
- package/index.d.cts +159 -26
- package/index.d.ts +159 -26
- package/index.global.js +76 -79
- package/index.global.js.map +1 -1
- package/index.js +75 -78
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -231,6 +231,8 @@ type AxFunctionJSONSchema = {
|
|
|
231
231
|
}>;
|
|
232
232
|
required?: string[];
|
|
233
233
|
items?: AxFunctionJSONSchema;
|
|
234
|
+
title?: string;
|
|
235
|
+
additionalProperties?: boolean;
|
|
234
236
|
};
|
|
235
237
|
type AxFunction = {
|
|
236
238
|
name: string;
|
|
@@ -428,6 +430,10 @@ type AxChatRequest<TModel = string> = {
|
|
|
428
430
|
name: string;
|
|
429
431
|
};
|
|
430
432
|
};
|
|
433
|
+
responseFormat?: {
|
|
434
|
+
type: 'json_object' | 'json_schema';
|
|
435
|
+
schema?: any;
|
|
436
|
+
};
|
|
431
437
|
modelConfig?: AxModelConfig;
|
|
432
438
|
model?: TModel;
|
|
433
439
|
};
|
|
@@ -607,12 +613,20 @@ interface AxAIMemory {
|
|
|
607
613
|
}
|
|
608
614
|
|
|
609
615
|
interface AxFieldType {
|
|
610
|
-
readonly type: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'datetime' | 'class' | 'code';
|
|
616
|
+
readonly type: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'datetime' | 'class' | 'code' | 'object';
|
|
611
617
|
readonly isArray?: boolean;
|
|
612
618
|
readonly options?: readonly string[];
|
|
619
|
+
readonly fields?: Record<string, AxFieldType>;
|
|
613
620
|
readonly description?: string;
|
|
614
621
|
readonly isOptional?: boolean;
|
|
615
622
|
readonly isInternal?: boolean;
|
|
623
|
+
readonly minLength?: number;
|
|
624
|
+
readonly maxLength?: number;
|
|
625
|
+
readonly minimum?: number;
|
|
626
|
+
readonly maximum?: number;
|
|
627
|
+
readonly pattern?: string;
|
|
628
|
+
readonly patternDescription?: string;
|
|
629
|
+
readonly format?: string;
|
|
616
630
|
}
|
|
617
631
|
declare class AxSignatureBuilder<_TInput extends Record<string, any> = {}, _TOutput extends Record<string, any> = {}> {
|
|
618
632
|
private inputFields;
|
|
@@ -624,14 +638,14 @@ declare class AxSignatureBuilder<_TInput extends Record<string, any> = {}, _TOut
|
|
|
624
638
|
* @param fieldInfo - Field type created with f.string(), f.number(), etc.
|
|
625
639
|
* @param prepend - If true, adds field to the beginning of input fields
|
|
626
640
|
*/
|
|
627
|
-
input<K extends string, T extends AxFluentFieldInfo<any, any, any, any> | AxFluentFieldType<any, any, any, any, any>>(name: K, fieldInfo: T, prepend?: boolean): AxSignatureBuilder<AddFieldToShape<_TInput, K, T>, _TOutput>;
|
|
641
|
+
input<K extends string, T extends AxFluentFieldInfo<any, any, any, any, any, any> | AxFluentFieldType<any, any, any, any, any, any>>(name: K, fieldInfo: T, prepend?: boolean): AxSignatureBuilder<AddFieldToShape<_TInput, K, T>, _TOutput>;
|
|
628
642
|
/**
|
|
629
643
|
* Add an output field to the signature
|
|
630
644
|
* @param name - Field name
|
|
631
645
|
* @param fieldInfo - Field type created with f.string(), f.number(), etc.
|
|
632
646
|
* @param prepend - If true, adds field to the beginning of output fields
|
|
633
647
|
*/
|
|
634
|
-
output<K extends string, T extends AxFluentFieldInfo<any, any, any, any> | AxFluentFieldType<any, any, any, any, any>>(name: K, fieldInfo: T, prepend?: boolean): AxSignatureBuilder<_TInput, AddFieldToShape<_TOutput, K, T>>;
|
|
648
|
+
output<K extends string, T extends AxFluentFieldInfo<any, any, any, any, any, any> | AxFluentFieldType<any, any, any, any, any, any>>(name: K, fieldInfo: T, prepend?: boolean): AxSignatureBuilder<_TInput, AddFieldToShape<_TOutput, K, T>>;
|
|
635
649
|
/**
|
|
636
650
|
* Set the description for the signature
|
|
637
651
|
* @param description - Description text
|
|
@@ -642,13 +656,21 @@ declare class AxSignatureBuilder<_TInput extends Record<string, any> = {}, _TOut
|
|
|
642
656
|
*/
|
|
643
657
|
build(): AxSignature<_TInput, _TOutput>;
|
|
644
658
|
}
|
|
645
|
-
declare class AxFluentFieldType<TType extends AxFieldType['type'] = AxFieldType['type'], TIsArray extends boolean = false, TOptions extends readonly string[] | undefined = undefined, TIsOptional extends boolean = false, TIsInternal extends boolean = false> implements AxFieldType {
|
|
659
|
+
declare class AxFluentFieldType<TType extends AxFieldType['type'] = AxFieldType['type'], TIsArray extends boolean = false, TOptions extends readonly string[] | undefined = undefined, TIsOptional extends boolean = false, TIsInternal extends boolean = false, TFields extends Record<string, AxFluentFieldInfo | AxFluentFieldType> | undefined = undefined> implements AxFieldType {
|
|
646
660
|
readonly type: TType;
|
|
647
661
|
readonly isArray: TIsArray;
|
|
648
662
|
readonly options?: TOptions;
|
|
649
663
|
readonly description?: string;
|
|
650
664
|
readonly isOptional: TIsOptional;
|
|
651
665
|
readonly isInternal: TIsInternal;
|
|
666
|
+
readonly fields?: any;
|
|
667
|
+
readonly minLength?: number;
|
|
668
|
+
readonly maxLength?: number;
|
|
669
|
+
readonly minimum?: number;
|
|
670
|
+
readonly maximum?: number;
|
|
671
|
+
readonly pattern?: string;
|
|
672
|
+
readonly patternDescription?: string;
|
|
673
|
+
readonly format?: string;
|
|
652
674
|
constructor(fieldType: {
|
|
653
675
|
type: TType;
|
|
654
676
|
isArray: TIsArray;
|
|
@@ -656,33 +678,84 @@ declare class AxFluentFieldType<TType extends AxFieldType['type'] = AxFieldType[
|
|
|
656
678
|
description?: string;
|
|
657
679
|
isOptional: TIsOptional;
|
|
658
680
|
isInternal: TIsInternal;
|
|
681
|
+
fields?: TFields;
|
|
682
|
+
minLength?: number;
|
|
683
|
+
maxLength?: number;
|
|
684
|
+
minimum?: number;
|
|
685
|
+
maximum?: number;
|
|
686
|
+
pattern?: string;
|
|
687
|
+
patternDescription?: string;
|
|
688
|
+
format?: string;
|
|
659
689
|
});
|
|
660
|
-
optional(): AxFluentFieldType<TType, TIsArray, TOptions, true, TIsInternal>;
|
|
661
|
-
array(): AxFluentFieldType<TType, true, TOptions, TIsOptional, TIsInternal>;
|
|
662
|
-
internal(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, true>;
|
|
690
|
+
optional(): AxFluentFieldType<TType, TIsArray, TOptions, true, TIsInternal, TFields>;
|
|
691
|
+
array(desc?: string): AxFluentFieldType<TType, true, TOptions, TIsOptional, TIsInternal, TFields>;
|
|
692
|
+
internal(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, true, TFields>;
|
|
693
|
+
/**
|
|
694
|
+
* Set minimum value for numbers or minimum length for strings
|
|
695
|
+
*/
|
|
696
|
+
min(value: number): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields>;
|
|
697
|
+
/**
|
|
698
|
+
* Set maximum value for numbers or maximum length for strings
|
|
699
|
+
*/
|
|
700
|
+
max(value: number): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields>;
|
|
701
|
+
/**
|
|
702
|
+
* Set email format validation for strings
|
|
703
|
+
*/
|
|
704
|
+
email(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields>;
|
|
705
|
+
/**
|
|
706
|
+
* Set URL/URI format validation for strings
|
|
707
|
+
*/
|
|
708
|
+
url(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields>;
|
|
709
|
+
/**
|
|
710
|
+
* Set regex pattern validation for strings
|
|
711
|
+
* @param pattern - Regular expression pattern to match
|
|
712
|
+
* @param description - Human-readable description of what the pattern validates (e.g., "Must be a valid username with only lowercase letters, numbers, and underscores")
|
|
713
|
+
*/
|
|
714
|
+
regex(pattern: string, description: string): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields>;
|
|
663
715
|
}
|
|
716
|
+
type ValidateNoMediaTypes<TFields> = {
|
|
717
|
+
[K in keyof TFields]: TFields[K] extends {
|
|
718
|
+
type: infer T;
|
|
719
|
+
} ? T extends 'image' | 'audio' | 'file' ? {
|
|
720
|
+
__error: `Type '${T extends string ? T : never}' cannot be used in f.object(). Media types (image, audio, file) are only allowed as top-level input fields, not within nested objects.`;
|
|
721
|
+
__suggestion: 'Use string, number, boolean, or nested f.object() instead.';
|
|
722
|
+
} : TFields[K] extends {
|
|
723
|
+
fields: infer TNestedFields;
|
|
724
|
+
} ? TNestedFields extends Record<string, any> ? TFields[K] & {
|
|
725
|
+
fields: ValidateNoMediaTypes<TNestedFields>;
|
|
726
|
+
} : TFields[K] : TFields[K] : TFields[K];
|
|
727
|
+
};
|
|
664
728
|
declare const f: (() => AxSignatureBuilder) & {
|
|
665
|
-
string: (desc?: string) => AxFluentFieldType<"string", false, undefined, false, false>;
|
|
666
|
-
number: (desc?: string) => AxFluentFieldType<"number", false, undefined, false, false>;
|
|
667
|
-
boolean: (desc?: string) => AxFluentFieldType<"boolean", false, undefined, false, false>;
|
|
668
|
-
json: (desc?: string) => AxFluentFieldType<"json", false, undefined, false, false>;
|
|
669
|
-
datetime: (desc?: string) => AxFluentFieldType<"datetime", false, undefined, false, false>;
|
|
670
|
-
date: (desc?: string) => AxFluentFieldType<"date", false, undefined, false, false>;
|
|
671
|
-
class: <const TOptions extends readonly string[]>(options: TOptions, desc?: string) => AxFluentFieldType<"class", false, TOptions, false, false>;
|
|
672
|
-
image: (desc?: string) => AxFluentFieldType<"image", false, undefined, false, false>;
|
|
673
|
-
audio: (desc?: string) => AxFluentFieldType<"audio", false, undefined, false, false>;
|
|
674
|
-
file: (desc?: string) => AxFluentFieldType<"file", false, undefined, false, false>;
|
|
675
|
-
url: (desc?: string) => AxFluentFieldType<"url", false, undefined, false, false>;
|
|
676
|
-
code: (language?: string, desc?: string) => AxFluentFieldType<"code", false, undefined, false, false>;
|
|
729
|
+
string: (desc?: string) => AxFluentFieldType<"string", false, undefined, false, false, undefined>;
|
|
730
|
+
number: (desc?: string) => AxFluentFieldType<"number", false, undefined, false, false, undefined>;
|
|
731
|
+
boolean: (desc?: string) => AxFluentFieldType<"boolean", false, undefined, false, false, undefined>;
|
|
732
|
+
json: (desc?: string) => AxFluentFieldType<"json", false, undefined, false, false, undefined>;
|
|
733
|
+
datetime: (desc?: string) => AxFluentFieldType<"datetime", false, undefined, false, false, undefined>;
|
|
734
|
+
date: (desc?: string) => AxFluentFieldType<"date", false, undefined, false, false, undefined>;
|
|
735
|
+
class: <const TOptions extends readonly string[]>(options: TOptions, desc?: string) => AxFluentFieldType<"class", false, TOptions, false, false, undefined>;
|
|
736
|
+
image: (desc?: string) => AxFluentFieldType<"image", false, undefined, false, false, undefined>;
|
|
737
|
+
audio: (desc?: string) => AxFluentFieldType<"audio", false, undefined, false, false, undefined>;
|
|
738
|
+
file: (desc?: string) => AxFluentFieldType<"file", false, undefined, false, false, undefined>;
|
|
739
|
+
url: (desc?: string) => AxFluentFieldType<"url", false, undefined, false, false, undefined>;
|
|
740
|
+
code: (language?: string, desc?: string) => AxFluentFieldType<"code", false, undefined, false, false, undefined>;
|
|
741
|
+
object: <TFields extends Record<string, AxFluentFieldInfo<any, any, any, any, any, any> | AxFluentFieldType<any, any, any, any, any, any>>>(fields: TFields & ValidateNoMediaTypes<TFields>, desc?: string) => AxFluentFieldType<"object", false, undefined, false, false, TFields>;
|
|
677
742
|
};
|
|
678
743
|
interface AxField {
|
|
679
744
|
name: string;
|
|
680
745
|
title?: string;
|
|
681
746
|
description?: string;
|
|
682
747
|
type?: {
|
|
683
|
-
name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'datetime' | 'class' | 'code';
|
|
748
|
+
name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'datetime' | 'class' | 'code' | 'object';
|
|
684
749
|
isArray?: boolean;
|
|
685
750
|
options?: string[];
|
|
751
|
+
fields?: Record<string, AxFieldType>;
|
|
752
|
+
minLength?: number;
|
|
753
|
+
maxLength?: number;
|
|
754
|
+
minimum?: number;
|
|
755
|
+
maximum?: number;
|
|
756
|
+
pattern?: string;
|
|
757
|
+
patternDescription?: string;
|
|
758
|
+
format?: string;
|
|
686
759
|
};
|
|
687
760
|
isOptional?: boolean;
|
|
688
761
|
isInternal?: boolean;
|
|
@@ -714,14 +787,28 @@ type InferFieldValueType<T> = T extends AxFieldType | AxFluentFieldType ? T['typ
|
|
|
714
787
|
} | {
|
|
715
788
|
mimeType: string;
|
|
716
789
|
fileUri: string;
|
|
717
|
-
} : T['type'] extends 'url' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'code' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'class' ? T['options'] extends readonly (infer U)[] ? T['isArray'] extends true ? U[] : U : T['isArray'] extends true ? string[] : string :
|
|
718
|
-
|
|
790
|
+
} : T['type'] extends 'url' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'code' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'class' ? T['options'] extends readonly (infer U)[] ? T['isArray'] extends true ? U[] : U : T['isArray'] extends true ? string[] : string : T['type'] extends 'object' ? T extends {
|
|
791
|
+
fields: infer F;
|
|
792
|
+
} ? F extends Record<string, any> ? T['isArray'] extends true ? {
|
|
793
|
+
[K in keyof F]: InferFluentType<F[K]>;
|
|
794
|
+
}[] : {
|
|
795
|
+
[K in keyof F]: InferFluentType<F[K]>;
|
|
796
|
+
} : any : any : any : any;
|
|
797
|
+
interface AxFluentFieldInfo<TType extends AxFieldType['type'] = AxFieldType['type'], TIsArray extends boolean = false, TOptions extends readonly string[] = readonly string[], TIsOptional extends boolean = false, _TIsInternal extends boolean = false, TFields extends Record<string, AxFluentFieldInfo | AxFluentFieldType> | undefined = undefined> {
|
|
719
798
|
readonly type: TType;
|
|
720
799
|
readonly isArray?: TIsArray;
|
|
721
800
|
readonly options?: TOptions;
|
|
801
|
+
readonly fields?: TFields;
|
|
722
802
|
readonly description?: string;
|
|
723
803
|
readonly isOptional?: TIsOptional;
|
|
724
804
|
readonly isInternal?: boolean;
|
|
805
|
+
readonly minLength?: number;
|
|
806
|
+
readonly maxLength?: number;
|
|
807
|
+
readonly minimum?: number;
|
|
808
|
+
readonly maximum?: number;
|
|
809
|
+
readonly pattern?: string;
|
|
810
|
+
readonly patternDescription?: string;
|
|
811
|
+
readonly format?: string;
|
|
725
812
|
}
|
|
726
813
|
type InferFluentType<T extends AxFluentFieldInfo<any, any, any, any> | AxFluentFieldType> = T['type'] extends 'string' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'number' ? T['isArray'] extends true ? number[] : number : T['type'] extends 'boolean' ? T['isArray'] extends true ? boolean[] : boolean : T['type'] extends 'json' ? T['isArray'] extends true ? any[] : any : T['type'] extends 'date' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'datetime' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'image' ? T['isArray'] extends true ? {
|
|
727
814
|
mimeType: string;
|
|
@@ -747,7 +834,13 @@ type InferFluentType<T extends AxFluentFieldInfo<any, any, any, any> | AxFluentF
|
|
|
747
834
|
} | {
|
|
748
835
|
mimeType: string;
|
|
749
836
|
fileUri: string;
|
|
750
|
-
} : T['type'] extends 'url' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'code' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'class' ? T['options'] extends readonly (infer U)[] ? T['isArray'] extends true ? U[] : U : T['isArray'] extends true ? string[] : string :
|
|
837
|
+
} : T['type'] extends 'url' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'code' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'class' ? T['options'] extends readonly (infer U)[] ? T['isArray'] extends true ? U[] : U : T['isArray'] extends true ? string[] : string : T['type'] extends 'object' ? T extends {
|
|
838
|
+
fields: infer F;
|
|
839
|
+
} ? F extends Record<string, any> ? T['isArray'] extends true ? {
|
|
840
|
+
[K in keyof F]: InferFluentType<F[K]>;
|
|
841
|
+
}[] : {
|
|
842
|
+
[K in keyof F]: InferFluentType<F[K]>;
|
|
843
|
+
} : any : any : any;
|
|
751
844
|
type _IsInternal<T> = T extends {
|
|
752
845
|
readonly isInternal: true;
|
|
753
846
|
} ? true : false;
|
|
@@ -808,7 +901,6 @@ declare class AxSignature<_TInput extends Record<string, any> = Record<string, a
|
|
|
808
901
|
prependOutputField: <K extends string, T extends AxFieldType>(name: K, fieldType: T) => AxSignature<_TInput, Record<K, InferFieldValueType<T>> & _TOutput>;
|
|
809
902
|
private invalidateValidationCache;
|
|
810
903
|
private toTitle;
|
|
811
|
-
toJSONSchema: () => AxFunctionJSONSchema;
|
|
812
904
|
private updateHashLight;
|
|
813
905
|
private updateHash;
|
|
814
906
|
private validateSignatureConsistency;
|
|
@@ -821,6 +913,7 @@ declare class AxSignature<_TInput extends Record<string, any> = Record<string, a
|
|
|
821
913
|
inputFields: AxIField[];
|
|
822
914
|
outputFields: AxIField[];
|
|
823
915
|
};
|
|
916
|
+
toJSONSchema: () => AxFunctionJSONSchema;
|
|
824
917
|
}
|
|
825
918
|
|
|
826
919
|
interface AxAssertion<T = Record<string, unknown>> {
|
|
@@ -1777,6 +1870,15 @@ declare class AxGen<IN = any, OUT extends AxGenOut = any> extends AxProgram<IN,
|
|
|
1777
1870
|
private forwardSendRequest;
|
|
1778
1871
|
private forwardCore;
|
|
1779
1872
|
private _forward2;
|
|
1873
|
+
/**
|
|
1874
|
+
* Validate input values against field constraints
|
|
1875
|
+
* @throws ValidationError if any input value fails validation
|
|
1876
|
+
*/
|
|
1877
|
+
private validateInputs;
|
|
1878
|
+
/**
|
|
1879
|
+
* Recursively validate object field values
|
|
1880
|
+
*/
|
|
1881
|
+
private validateObjectFields;
|
|
1780
1882
|
_forward1(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options: Readonly<AxProgramForwardOptions<any>>): AxGenStreamingOut<OUT>;
|
|
1781
1883
|
forward<T extends Readonly<AxAIService>>(ai: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptionsWithModels<T>>): Promise<OUT>;
|
|
1782
1884
|
streamingForward<T extends Readonly<AxAIService>>(ai: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptionsWithModels<T>>): AxGenStreamingOut<OUT>;
|
|
@@ -1884,6 +1986,15 @@ declare class AxPromptTemplate {
|
|
|
1884
1986
|
/**
|
|
1885
1987
|
* A map of string type names to their corresponding TypeScript types.
|
|
1886
1988
|
* Maps signature type strings to actual TypeScript types for type inference.
|
|
1989
|
+
*
|
|
1990
|
+
* IMPORTANT: The 'object' type is NOT included in this map because string signatures
|
|
1991
|
+
* cannot define structured object types. When 'object' appears in a string signature,
|
|
1992
|
+
* it's treated the same as 'json' and inferred as 'any'.
|
|
1993
|
+
*
|
|
1994
|
+
* For structured object types with proper type inference, use the fluent API:
|
|
1995
|
+
* f().output('user', f.object({ name: f.string(), age: f.number() }))
|
|
1996
|
+
*
|
|
1997
|
+
* See: STRING_SIGNATURE_LIMITATIONS.md
|
|
1887
1998
|
*/
|
|
1888
1999
|
interface TypeMap {
|
|
1889
2000
|
string: string;
|
|
@@ -2161,6 +2272,7 @@ type AxGenDeltaOut<OUT> = {
|
|
|
2161
2272
|
version: number;
|
|
2162
2273
|
index: number;
|
|
2163
2274
|
delta: Partial<OUT>;
|
|
2275
|
+
partial?: OUT;
|
|
2164
2276
|
};
|
|
2165
2277
|
type AxGenStreamingOut<OUT> = AsyncGenerator<AxGenDeltaOut<OUT>, void, unknown>;
|
|
2166
2278
|
type AxSetExamplesOptions = {};
|
|
@@ -2502,6 +2614,10 @@ type AxAIAnthropicChatRequest = {
|
|
|
2502
2614
|
top_p?: number;
|
|
2503
2615
|
top_k?: number;
|
|
2504
2616
|
thinking?: AxAIAnthropicThinkingConfig;
|
|
2617
|
+
output_format?: {
|
|
2618
|
+
type: 'json_schema';
|
|
2619
|
+
schema: object;
|
|
2620
|
+
};
|
|
2505
2621
|
metadata?: {
|
|
2506
2622
|
user_id: string;
|
|
2507
2623
|
};
|
|
@@ -2558,6 +2674,8 @@ interface AxAIAnthropicMessageStartEvent {
|
|
|
2558
2674
|
usage: {
|
|
2559
2675
|
input_tokens: number;
|
|
2560
2676
|
output_tokens: number;
|
|
2677
|
+
cache_creation_input_tokens?: number;
|
|
2678
|
+
cache_read_input_tokens?: number;
|
|
2561
2679
|
};
|
|
2562
2680
|
};
|
|
2563
2681
|
}
|
|
@@ -2819,6 +2937,9 @@ type AxAIOpenAIChatRequest<TModel> = {
|
|
|
2819
2937
|
};
|
|
2820
2938
|
response_format?: {
|
|
2821
2939
|
type: string;
|
|
2940
|
+
} | {
|
|
2941
|
+
type: 'json_schema';
|
|
2942
|
+
json_schema: any;
|
|
2822
2943
|
};
|
|
2823
2944
|
max_completion_tokens?: number;
|
|
2824
2945
|
temperature?: number;
|
|
@@ -3490,11 +3611,15 @@ declare class AxAIDeepSeek<TModelKey> extends AxAIOpenAIBase<AxAIDeepSeekModel,
|
|
|
3490
3611
|
declare const axModelInfoDeepSeek: AxModelInfo[];
|
|
3491
3612
|
|
|
3492
3613
|
declare enum AxAIGoogleGeminiModel {
|
|
3614
|
+
Gemini3ProPreview = "gemini-3-pro-preview",
|
|
3615
|
+
Gemini3ProImagePreview = "gemini-3-pro-image-preview",
|
|
3493
3616
|
Gemini25Pro = "gemini-2.5-pro",
|
|
3494
3617
|
Gemini25Flash = "gemini-2.5-flash",
|
|
3495
3618
|
Gemini25FlashLite = "gemini-2.5-flash-lite",
|
|
3496
3619
|
Gemini20Flash = "gemini-2.0-flash",
|
|
3497
3620
|
Gemini20FlashLite = "gemini-2.0-flash-lite",
|
|
3621
|
+
Gemini20ProExp = "gemini-2.0-pro-exp-02-05",
|
|
3622
|
+
Gemini20FlashThinkingExp = "gemini-2.0-flash-thinking-exp-01-21",
|
|
3498
3623
|
Gemini1Pro = "gemini-1.0-pro",
|
|
3499
3624
|
Gemini15Flash = "gemini-1.5-flash",
|
|
3500
3625
|
Gemini15Flash002 = "gemini-1.5-flash-002",
|
|
@@ -3539,11 +3664,15 @@ type AxAIGoogleGeminiContent = {
|
|
|
3539
3664
|
};
|
|
3540
3665
|
type AxAIGoogleGeminiContentPart = {
|
|
3541
3666
|
thought?: boolean;
|
|
3667
|
+
thoughtSignature?: string;
|
|
3542
3668
|
metadata?: {
|
|
3543
3669
|
videoMetadata: object;
|
|
3544
3670
|
};
|
|
3545
3671
|
} & ({
|
|
3546
3672
|
text: string;
|
|
3673
|
+
thought?: boolean;
|
|
3674
|
+
} | {
|
|
3675
|
+
thought: string;
|
|
3547
3676
|
} | {
|
|
3548
3677
|
inlineData: {
|
|
3549
3678
|
mimeType: string;
|
|
@@ -3607,8 +3736,10 @@ type AxAIGoogleGeminiGenerationConfig = {
|
|
|
3607
3736
|
maxOutputTokens?: number;
|
|
3608
3737
|
stopSequences?: readonly string[];
|
|
3609
3738
|
responseMimeType?: string;
|
|
3739
|
+
responseSchema?: object;
|
|
3610
3740
|
thinkingConfig?: {
|
|
3611
3741
|
thinkingBudget?: number;
|
|
3742
|
+
thinkingLevel?: 'low' | 'high';
|
|
3612
3743
|
includeThoughts?: boolean;
|
|
3613
3744
|
};
|
|
3614
3745
|
};
|
|
@@ -3668,6 +3799,7 @@ type AxAIGoogleGeminiChatResponse = {
|
|
|
3668
3799
|
type AxAIGoogleGeminiChatResponseDelta = AxAIGoogleGeminiChatResponse;
|
|
3669
3800
|
type AxAIGoogleGeminiThinkingConfig = {
|
|
3670
3801
|
thinkingTokenBudget?: number;
|
|
3802
|
+
thinkingLevel?: 'low' | 'high';
|
|
3671
3803
|
includeThoughts?: boolean;
|
|
3672
3804
|
};
|
|
3673
3805
|
type AxAIGoogleGeminiThinkingTokenBudgetLevels = {
|
|
@@ -3690,6 +3822,7 @@ type AxAIGoogleGeminiConfig = AxModelConfig & {
|
|
|
3690
3822
|
thinking?: AxAIGoogleGeminiThinkingConfig;
|
|
3691
3823
|
thinkingTokenBudgetLevels?: AxAIGoogleGeminiThinkingTokenBudgetLevels;
|
|
3692
3824
|
urlContext?: string;
|
|
3825
|
+
responseFormat?: 'json_object';
|
|
3693
3826
|
};
|
|
3694
3827
|
/**
|
|
3695
3828
|
* AxAIGoogleGeminiEmbedRequest: Structure for making an embedding request to the Google Gemini API.
|
|
@@ -7293,13 +7426,13 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
7293
7426
|
* // Create a chain-of-thought node
|
|
7294
7427
|
* flow.nodeExtended('reasoner', 'question:string -> answer:string', {
|
|
7295
7428
|
* prependOutputs: [
|
|
7296
|
-
* { name: 'reasoning', type: f.
|
|
7429
|
+
* { name: 'reasoning', type: f.string('Step-by-step reasoning').internal() }
|
|
7297
7430
|
* ]
|
|
7298
7431
|
* })
|
|
7299
7432
|
*
|
|
7300
7433
|
* // Create a node with context and confidence
|
|
7301
7434
|
* flow.nodeExtended('analyzer', 'input:string -> output:string', {
|
|
7302
|
-
* appendInputs: [{ name: 'context', type: f.
|
|
7435
|
+
* appendInputs: [{ name: 'context', type: f.string('Context').optional() }],
|
|
7303
7436
|
* appendOutputs: [{ name: 'confidence', type: f.number('Confidence score') }]
|
|
7304
7437
|
* })
|
|
7305
7438
|
* ```
|