@ax-llm/ax 14.0.39 → 14.0.41
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 +168 -26
- package/index.d.ts +168 -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.ts
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,93 @@ 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>;
|
|
715
|
+
/**
|
|
716
|
+
* Set date format validation for strings
|
|
717
|
+
*/
|
|
718
|
+
date(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields>;
|
|
719
|
+
/**
|
|
720
|
+
* Set datetime format validation for strings
|
|
721
|
+
*/
|
|
722
|
+
datetime(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields>;
|
|
663
723
|
}
|
|
724
|
+
type ValidateNoMediaTypes<TFields> = {
|
|
725
|
+
[K in keyof TFields]: TFields[K] extends {
|
|
726
|
+
type: infer T;
|
|
727
|
+
} ? T extends 'image' | 'audio' | 'file' ? {
|
|
728
|
+
__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.`;
|
|
729
|
+
__suggestion: 'Use string, number, boolean, or nested f.object() instead.';
|
|
730
|
+
} : TFields[K] extends {
|
|
731
|
+
fields: infer TNestedFields;
|
|
732
|
+
} ? TNestedFields extends Record<string, any> ? TFields[K] & {
|
|
733
|
+
fields: ValidateNoMediaTypes<TNestedFields>;
|
|
734
|
+
} : TFields[K] : TFields[K] : TFields[K];
|
|
735
|
+
};
|
|
664
736
|
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
|
-
|
|
737
|
+
string: (desc?: string) => AxFluentFieldType<"string", false, undefined, false, false, undefined>;
|
|
738
|
+
number: (desc?: string) => AxFluentFieldType<"number", false, undefined, false, false, undefined>;
|
|
739
|
+
boolean: (desc?: string) => AxFluentFieldType<"boolean", false, undefined, false, false, undefined>;
|
|
740
|
+
json: (desc?: string) => AxFluentFieldType<"json", false, undefined, false, false, undefined>;
|
|
741
|
+
datetime: (desc?: string) => AxFluentFieldType<"datetime", false, undefined, false, false, undefined>;
|
|
742
|
+
date: (desc?: string) => AxFluentFieldType<"date", false, undefined, false, false, undefined>;
|
|
743
|
+
class: <const TOptions extends readonly string[]>(options: TOptions, desc?: string) => AxFluentFieldType<"class", false, TOptions, false, false, undefined>;
|
|
744
|
+
image: (desc?: string) => AxFluentFieldType<"image", false, undefined, false, false, undefined>;
|
|
745
|
+
audio: (desc?: string) => AxFluentFieldType<"audio", false, undefined, false, false, undefined>;
|
|
746
|
+
file: (desc?: string) => AxFluentFieldType<"file", false, undefined, false, false, undefined>;
|
|
747
|
+
url: (desc?: string) => AxFluentFieldType<"url", false, undefined, false, false, undefined>;
|
|
748
|
+
email: (desc?: string) => AxFluentFieldType<"string", false, undefined, false, false, undefined>;
|
|
749
|
+
code: (language?: string, desc?: string) => AxFluentFieldType<"code", false, undefined, false, false, undefined>;
|
|
750
|
+
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
751
|
};
|
|
678
752
|
interface AxField {
|
|
679
753
|
name: string;
|
|
680
754
|
title?: string;
|
|
681
755
|
description?: string;
|
|
682
756
|
type?: {
|
|
683
|
-
name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'datetime' | 'class' | 'code';
|
|
757
|
+
name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'datetime' | 'class' | 'code' | 'object';
|
|
684
758
|
isArray?: boolean;
|
|
685
759
|
options?: string[];
|
|
760
|
+
fields?: Record<string, AxFieldType>;
|
|
761
|
+
minLength?: number;
|
|
762
|
+
maxLength?: number;
|
|
763
|
+
minimum?: number;
|
|
764
|
+
maximum?: number;
|
|
765
|
+
pattern?: string;
|
|
766
|
+
patternDescription?: string;
|
|
767
|
+
format?: string;
|
|
686
768
|
};
|
|
687
769
|
isOptional?: boolean;
|
|
688
770
|
isInternal?: boolean;
|
|
@@ -714,14 +796,28 @@ type InferFieldValueType<T> = T extends AxFieldType | AxFluentFieldType ? T['typ
|
|
|
714
796
|
} | {
|
|
715
797
|
mimeType: string;
|
|
716
798
|
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
|
-
|
|
799
|
+
} : 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 {
|
|
800
|
+
fields: infer F;
|
|
801
|
+
} ? F extends Record<string, any> ? T['isArray'] extends true ? {
|
|
802
|
+
[K in keyof F]: InferFluentType<F[K]>;
|
|
803
|
+
}[] : {
|
|
804
|
+
[K in keyof F]: InferFluentType<F[K]>;
|
|
805
|
+
} : any : any : any : any;
|
|
806
|
+
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
807
|
readonly type: TType;
|
|
720
808
|
readonly isArray?: TIsArray;
|
|
721
809
|
readonly options?: TOptions;
|
|
810
|
+
readonly fields?: TFields;
|
|
722
811
|
readonly description?: string;
|
|
723
812
|
readonly isOptional?: TIsOptional;
|
|
724
813
|
readonly isInternal?: boolean;
|
|
814
|
+
readonly minLength?: number;
|
|
815
|
+
readonly maxLength?: number;
|
|
816
|
+
readonly minimum?: number;
|
|
817
|
+
readonly maximum?: number;
|
|
818
|
+
readonly pattern?: string;
|
|
819
|
+
readonly patternDescription?: string;
|
|
820
|
+
readonly format?: string;
|
|
725
821
|
}
|
|
726
822
|
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
823
|
mimeType: string;
|
|
@@ -747,7 +843,13 @@ type InferFluentType<T extends AxFluentFieldInfo<any, any, any, any> | AxFluentF
|
|
|
747
843
|
} | {
|
|
748
844
|
mimeType: string;
|
|
749
845
|
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 :
|
|
846
|
+
} : 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 {
|
|
847
|
+
fields: infer F;
|
|
848
|
+
} ? F extends Record<string, any> ? T['isArray'] extends true ? {
|
|
849
|
+
[K in keyof F]: InferFluentType<F[K]>;
|
|
850
|
+
}[] : {
|
|
851
|
+
[K in keyof F]: InferFluentType<F[K]>;
|
|
852
|
+
} : any : any : any;
|
|
751
853
|
type _IsInternal<T> = T extends {
|
|
752
854
|
readonly isInternal: true;
|
|
753
855
|
} ? true : false;
|
|
@@ -808,7 +910,6 @@ declare class AxSignature<_TInput extends Record<string, any> = Record<string, a
|
|
|
808
910
|
prependOutputField: <K extends string, T extends AxFieldType>(name: K, fieldType: T) => AxSignature<_TInput, Record<K, InferFieldValueType<T>> & _TOutput>;
|
|
809
911
|
private invalidateValidationCache;
|
|
810
912
|
private toTitle;
|
|
811
|
-
toJSONSchema: () => AxFunctionJSONSchema;
|
|
812
913
|
private updateHashLight;
|
|
813
914
|
private updateHash;
|
|
814
915
|
private validateSignatureConsistency;
|
|
@@ -821,6 +922,7 @@ declare class AxSignature<_TInput extends Record<string, any> = Record<string, a
|
|
|
821
922
|
inputFields: AxIField[];
|
|
822
923
|
outputFields: AxIField[];
|
|
823
924
|
};
|
|
925
|
+
toJSONSchema: () => AxFunctionJSONSchema;
|
|
824
926
|
}
|
|
825
927
|
|
|
826
928
|
interface AxAssertion<T = Record<string, unknown>> {
|
|
@@ -1777,6 +1879,15 @@ declare class AxGen<IN = any, OUT extends AxGenOut = any> extends AxProgram<IN,
|
|
|
1777
1879
|
private forwardSendRequest;
|
|
1778
1880
|
private forwardCore;
|
|
1779
1881
|
private _forward2;
|
|
1882
|
+
/**
|
|
1883
|
+
* Validate input values against field constraints
|
|
1884
|
+
* @throws ValidationError if any input value fails validation
|
|
1885
|
+
*/
|
|
1886
|
+
private validateInputs;
|
|
1887
|
+
/**
|
|
1888
|
+
* Recursively validate object field values
|
|
1889
|
+
*/
|
|
1890
|
+
private validateObjectFields;
|
|
1780
1891
|
_forward1(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options: Readonly<AxProgramForwardOptions<any>>): AxGenStreamingOut<OUT>;
|
|
1781
1892
|
forward<T extends Readonly<AxAIService>>(ai: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptionsWithModels<T>>): Promise<OUT>;
|
|
1782
1893
|
streamingForward<T extends Readonly<AxAIService>>(ai: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptionsWithModels<T>>): AxGenStreamingOut<OUT>;
|
|
@@ -1884,6 +1995,15 @@ declare class AxPromptTemplate {
|
|
|
1884
1995
|
/**
|
|
1885
1996
|
* A map of string type names to their corresponding TypeScript types.
|
|
1886
1997
|
* Maps signature type strings to actual TypeScript types for type inference.
|
|
1998
|
+
*
|
|
1999
|
+
* IMPORTANT: The 'object' type is NOT included in this map because string signatures
|
|
2000
|
+
* cannot define structured object types. When 'object' appears in a string signature,
|
|
2001
|
+
* it's treated the same as 'json' and inferred as 'any'.
|
|
2002
|
+
*
|
|
2003
|
+
* For structured object types with proper type inference, use the fluent API:
|
|
2004
|
+
* f().output('user', f.object({ name: f.string(), age: f.number() }))
|
|
2005
|
+
*
|
|
2006
|
+
* See: STRING_SIGNATURE_LIMITATIONS.md
|
|
1887
2007
|
*/
|
|
1888
2008
|
interface TypeMap {
|
|
1889
2009
|
string: string;
|
|
@@ -2161,6 +2281,7 @@ type AxGenDeltaOut<OUT> = {
|
|
|
2161
2281
|
version: number;
|
|
2162
2282
|
index: number;
|
|
2163
2283
|
delta: Partial<OUT>;
|
|
2284
|
+
partial?: OUT;
|
|
2164
2285
|
};
|
|
2165
2286
|
type AxGenStreamingOut<OUT> = AsyncGenerator<AxGenDeltaOut<OUT>, void, unknown>;
|
|
2166
2287
|
type AxSetExamplesOptions = {};
|
|
@@ -2502,6 +2623,10 @@ type AxAIAnthropicChatRequest = {
|
|
|
2502
2623
|
top_p?: number;
|
|
2503
2624
|
top_k?: number;
|
|
2504
2625
|
thinking?: AxAIAnthropicThinkingConfig;
|
|
2626
|
+
output_format?: {
|
|
2627
|
+
type: 'json_schema';
|
|
2628
|
+
schema: object;
|
|
2629
|
+
};
|
|
2505
2630
|
metadata?: {
|
|
2506
2631
|
user_id: string;
|
|
2507
2632
|
};
|
|
@@ -2558,6 +2683,8 @@ interface AxAIAnthropicMessageStartEvent {
|
|
|
2558
2683
|
usage: {
|
|
2559
2684
|
input_tokens: number;
|
|
2560
2685
|
output_tokens: number;
|
|
2686
|
+
cache_creation_input_tokens?: number;
|
|
2687
|
+
cache_read_input_tokens?: number;
|
|
2561
2688
|
};
|
|
2562
2689
|
};
|
|
2563
2690
|
}
|
|
@@ -2819,6 +2946,9 @@ type AxAIOpenAIChatRequest<TModel> = {
|
|
|
2819
2946
|
};
|
|
2820
2947
|
response_format?: {
|
|
2821
2948
|
type: string;
|
|
2949
|
+
} | {
|
|
2950
|
+
type: 'json_schema';
|
|
2951
|
+
json_schema: any;
|
|
2822
2952
|
};
|
|
2823
2953
|
max_completion_tokens?: number;
|
|
2824
2954
|
temperature?: number;
|
|
@@ -3490,11 +3620,15 @@ declare class AxAIDeepSeek<TModelKey> extends AxAIOpenAIBase<AxAIDeepSeekModel,
|
|
|
3490
3620
|
declare const axModelInfoDeepSeek: AxModelInfo[];
|
|
3491
3621
|
|
|
3492
3622
|
declare enum AxAIGoogleGeminiModel {
|
|
3623
|
+
Gemini3ProPreview = "gemini-3-pro-preview",
|
|
3624
|
+
Gemini3ProImagePreview = "gemini-3-pro-image-preview",
|
|
3493
3625
|
Gemini25Pro = "gemini-2.5-pro",
|
|
3494
3626
|
Gemini25Flash = "gemini-2.5-flash",
|
|
3495
3627
|
Gemini25FlashLite = "gemini-2.5-flash-lite",
|
|
3496
3628
|
Gemini20Flash = "gemini-2.0-flash",
|
|
3497
3629
|
Gemini20FlashLite = "gemini-2.0-flash-lite",
|
|
3630
|
+
Gemini20ProExp = "gemini-2.0-pro-exp-02-05",
|
|
3631
|
+
Gemini20FlashThinkingExp = "gemini-2.0-flash-thinking-exp-01-21",
|
|
3498
3632
|
Gemini1Pro = "gemini-1.0-pro",
|
|
3499
3633
|
Gemini15Flash = "gemini-1.5-flash",
|
|
3500
3634
|
Gemini15Flash002 = "gemini-1.5-flash-002",
|
|
@@ -3539,11 +3673,15 @@ type AxAIGoogleGeminiContent = {
|
|
|
3539
3673
|
};
|
|
3540
3674
|
type AxAIGoogleGeminiContentPart = {
|
|
3541
3675
|
thought?: boolean;
|
|
3676
|
+
thoughtSignature?: string;
|
|
3542
3677
|
metadata?: {
|
|
3543
3678
|
videoMetadata: object;
|
|
3544
3679
|
};
|
|
3545
3680
|
} & ({
|
|
3546
3681
|
text: string;
|
|
3682
|
+
thought?: boolean;
|
|
3683
|
+
} | {
|
|
3684
|
+
thought: string;
|
|
3547
3685
|
} | {
|
|
3548
3686
|
inlineData: {
|
|
3549
3687
|
mimeType: string;
|
|
@@ -3607,8 +3745,10 @@ type AxAIGoogleGeminiGenerationConfig = {
|
|
|
3607
3745
|
maxOutputTokens?: number;
|
|
3608
3746
|
stopSequences?: readonly string[];
|
|
3609
3747
|
responseMimeType?: string;
|
|
3748
|
+
responseSchema?: object;
|
|
3610
3749
|
thinkingConfig?: {
|
|
3611
3750
|
thinkingBudget?: number;
|
|
3751
|
+
thinkingLevel?: 'low' | 'high';
|
|
3612
3752
|
includeThoughts?: boolean;
|
|
3613
3753
|
};
|
|
3614
3754
|
};
|
|
@@ -3668,6 +3808,7 @@ type AxAIGoogleGeminiChatResponse = {
|
|
|
3668
3808
|
type AxAIGoogleGeminiChatResponseDelta = AxAIGoogleGeminiChatResponse;
|
|
3669
3809
|
type AxAIGoogleGeminiThinkingConfig = {
|
|
3670
3810
|
thinkingTokenBudget?: number;
|
|
3811
|
+
thinkingLevel?: 'low' | 'high';
|
|
3671
3812
|
includeThoughts?: boolean;
|
|
3672
3813
|
};
|
|
3673
3814
|
type AxAIGoogleGeminiThinkingTokenBudgetLevels = {
|
|
@@ -3690,6 +3831,7 @@ type AxAIGoogleGeminiConfig = AxModelConfig & {
|
|
|
3690
3831
|
thinking?: AxAIGoogleGeminiThinkingConfig;
|
|
3691
3832
|
thinkingTokenBudgetLevels?: AxAIGoogleGeminiThinkingTokenBudgetLevels;
|
|
3692
3833
|
urlContext?: string;
|
|
3834
|
+
responseFormat?: 'json_object';
|
|
3693
3835
|
};
|
|
3694
3836
|
/**
|
|
3695
3837
|
* AxAIGoogleGeminiEmbedRequest: Structure for making an embedding request to the Google Gemini API.
|
|
@@ -7293,13 +7435,13 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
7293
7435
|
* // Create a chain-of-thought node
|
|
7294
7436
|
* flow.nodeExtended('reasoner', 'question:string -> answer:string', {
|
|
7295
7437
|
* prependOutputs: [
|
|
7296
|
-
* { name: 'reasoning', type: f.
|
|
7438
|
+
* { name: 'reasoning', type: f.string('Step-by-step reasoning').internal() }
|
|
7297
7439
|
* ]
|
|
7298
7440
|
* })
|
|
7299
7441
|
*
|
|
7300
7442
|
* // Create a node with context and confidence
|
|
7301
7443
|
* flow.nodeExtended('analyzer', 'input:string -> output:string', {
|
|
7302
|
-
* appendInputs: [{ name: 'context', type: f.
|
|
7444
|
+
* appendInputs: [{ name: 'context', type: f.string('Context').optional() }],
|
|
7303
7445
|
* appendOutputs: [{ name: 'confidence', type: f.number('Confidence score') }]
|
|
7304
7446
|
* })
|
|
7305
7447
|
* ```
|