@ax-llm/ax 12.0.9 → 12.0.13
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 +2204 -1474
- package/index.cjs.map +1 -1
- package/index.d.cts +235 -192
- package/index.d.ts +235 -192
- package/index.js +2203 -1473
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -209,7 +209,13 @@ type AxFunction = {
|
|
|
209
209
|
parameters?: AxFunctionJSONSchema;
|
|
210
210
|
func: AxFunctionHandler;
|
|
211
211
|
};
|
|
212
|
+
type AxFunctionResult = Extract<AxChatRequest['chatPrompt'][number], {
|
|
213
|
+
role: 'function';
|
|
214
|
+
}> & {
|
|
215
|
+
index: number;
|
|
216
|
+
};
|
|
212
217
|
type AxChatResponseResult = {
|
|
218
|
+
index: number;
|
|
213
219
|
content?: string;
|
|
214
220
|
thought?: string;
|
|
215
221
|
name?: string;
|
|
@@ -415,8 +421,21 @@ declare enum AxAIAnthropicVertexModel {
|
|
|
415
421
|
Claude3Haiku = "claude-3-haiku",
|
|
416
422
|
Claude3Opus = "claude-3-opus"
|
|
417
423
|
}
|
|
424
|
+
type AxAIAnthropicThinkingConfig = {
|
|
425
|
+
type: 'enabled';
|
|
426
|
+
budget_tokens: number;
|
|
427
|
+
};
|
|
428
|
+
type AxAIAnthropicThinkingTokenBudgetLevels = {
|
|
429
|
+
minimal?: number;
|
|
430
|
+
low?: number;
|
|
431
|
+
medium?: number;
|
|
432
|
+
high?: number;
|
|
433
|
+
highest?: number;
|
|
434
|
+
};
|
|
418
435
|
type AxAIAnthropicConfig = AxModelConfig & {
|
|
419
436
|
model: AxAIAnthropicModel | AxAIAnthropicVertexModel;
|
|
437
|
+
thinking?: AxAIAnthropicThinkingConfig;
|
|
438
|
+
thinkingTokenBudgetLevels?: AxAIAnthropicThinkingTokenBudgetLevels;
|
|
420
439
|
};
|
|
421
440
|
type AxAIAnthropicChatRequestCacheParam = {
|
|
422
441
|
cache_control?: {
|
|
@@ -464,6 +483,14 @@ type AxAIAnthropicChatRequest = {
|
|
|
464
483
|
id: string;
|
|
465
484
|
name: string;
|
|
466
485
|
input: object;
|
|
486
|
+
} | {
|
|
487
|
+
type: 'thinking';
|
|
488
|
+
thinking: string;
|
|
489
|
+
signature?: string;
|
|
490
|
+
} | {
|
|
491
|
+
type: 'redacted_thinking';
|
|
492
|
+
thinking: string;
|
|
493
|
+
signature?: string;
|
|
467
494
|
})[];
|
|
468
495
|
})[];
|
|
469
496
|
tools?: ({
|
|
@@ -487,6 +514,7 @@ type AxAIAnthropicChatRequest = {
|
|
|
487
514
|
temperature?: number;
|
|
488
515
|
top_p?: number;
|
|
489
516
|
top_k?: number;
|
|
517
|
+
thinking?: AxAIAnthropicThinkingConfig;
|
|
490
518
|
metadata?: {
|
|
491
519
|
user_id: string;
|
|
492
520
|
};
|
|
@@ -503,6 +531,14 @@ type AxAIAnthropicChatResponse = {
|
|
|
503
531
|
name: string;
|
|
504
532
|
type: 'tool_use';
|
|
505
533
|
input?: string;
|
|
534
|
+
} | {
|
|
535
|
+
type: 'thinking';
|
|
536
|
+
thinking: string;
|
|
537
|
+
signature?: string;
|
|
538
|
+
} | {
|
|
539
|
+
type: 'redacted_thinking';
|
|
540
|
+
thinking: string;
|
|
541
|
+
signature?: string;
|
|
506
542
|
})[];
|
|
507
543
|
model: string;
|
|
508
544
|
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use';
|
|
@@ -546,6 +582,9 @@ interface AxAIAnthropicContentBlockStartEvent {
|
|
|
546
582
|
id: string;
|
|
547
583
|
name: string;
|
|
548
584
|
input: object;
|
|
585
|
+
} | {
|
|
586
|
+
type: 'thinking';
|
|
587
|
+
thinking: string;
|
|
549
588
|
};
|
|
550
589
|
}
|
|
551
590
|
interface AxAIAnthropicContentBlockDeltaEvent {
|
|
@@ -557,6 +596,12 @@ interface AxAIAnthropicContentBlockDeltaEvent {
|
|
|
557
596
|
} | {
|
|
558
597
|
type: 'input_json_delta';
|
|
559
598
|
partial_json: string;
|
|
599
|
+
} | {
|
|
600
|
+
type: 'thinking_delta';
|
|
601
|
+
thinking: string;
|
|
602
|
+
} | {
|
|
603
|
+
type: 'signature_delta';
|
|
604
|
+
signature: string;
|
|
560
605
|
};
|
|
561
606
|
}
|
|
562
607
|
interface AxAIAnthropicContentBlockStopEvent {
|
|
@@ -2086,20 +2131,26 @@ declare class AxAIGrok extends AxAIOpenAIBase<AxAIGrokModel, AxAIGrokEmbedModels
|
|
|
2086
2131
|
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIGrokArgs, 'name'>>);
|
|
2087
2132
|
}
|
|
2088
2133
|
|
|
2134
|
+
type AxMemoryData = {
|
|
2135
|
+
tags?: string[];
|
|
2136
|
+
role: AxChatRequest['chatPrompt'][number]['role'];
|
|
2137
|
+
chat: {
|
|
2138
|
+
index: number;
|
|
2139
|
+
value: Omit<AxChatRequest['chatPrompt'][number], 'role'>;
|
|
2140
|
+
}[];
|
|
2141
|
+
}[];
|
|
2089
2142
|
interface AxAIMemory {
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
updateResult(
|
|
2143
|
+
addRequest(result: AxChatRequest['chatPrompt'], sessionId?: string): void;
|
|
2144
|
+
addResponse(results: Readonly<AxChatResponseResult[]>, sessionId?: string): void;
|
|
2145
|
+
updateResult(results: Readonly<AxChatResponseResult> & {
|
|
2093
2146
|
delta?: string;
|
|
2094
2147
|
}, sessionId?: string): void;
|
|
2095
|
-
|
|
2148
|
+
addFunctionResults(results: Readonly<AxFunctionResult[]>, sessionId?: string): void;
|
|
2149
|
+
history(index: number, sessionId?: string): AxChatRequest['chatPrompt'];
|
|
2096
2150
|
reset(sessionId?: string): void;
|
|
2097
|
-
getLast(sessionId?: string):
|
|
2098
|
-
chat: AxChatRequest['chatPrompt'][number];
|
|
2099
|
-
tags?: string[];
|
|
2100
|
-
} | undefined;
|
|
2151
|
+
getLast(sessionId?: string): AxMemoryData[number] | undefined;
|
|
2101
2152
|
addTag(name: string, sessionId?: string): void;
|
|
2102
|
-
rewindToTag(name: string, sessionId?: string):
|
|
2153
|
+
rewindToTag(name: string, sessionId?: string): AxMemoryData;
|
|
2103
2154
|
}
|
|
2104
2155
|
|
|
2105
2156
|
interface AxField {
|
|
@@ -2157,6 +2208,33 @@ declare class AxSignature {
|
|
|
2157
2208
|
};
|
|
2158
2209
|
}
|
|
2159
2210
|
|
|
2211
|
+
type AxFieldValue = string | string[] | number | boolean | object | null | undefined | {
|
|
2212
|
+
mimeType: string;
|
|
2213
|
+
data: string;
|
|
2214
|
+
} | {
|
|
2215
|
+
mimeType: string;
|
|
2216
|
+
data: string;
|
|
2217
|
+
}[] | {
|
|
2218
|
+
format?: 'wav';
|
|
2219
|
+
data: string;
|
|
2220
|
+
} | {
|
|
2221
|
+
format?: 'wav';
|
|
2222
|
+
data: string;
|
|
2223
|
+
}[];
|
|
2224
|
+
type AxGenIn = {
|
|
2225
|
+
[key: string]: AxFieldValue;
|
|
2226
|
+
};
|
|
2227
|
+
type AxGenOut = {
|
|
2228
|
+
[key: string]: AxFieldValue;
|
|
2229
|
+
};
|
|
2230
|
+
type AxMessage<IN extends AxGenIn> = {
|
|
2231
|
+
role: 'user';
|
|
2232
|
+
values: IN;
|
|
2233
|
+
} | {
|
|
2234
|
+
role: 'assistant';
|
|
2235
|
+
values: IN;
|
|
2236
|
+
};
|
|
2237
|
+
|
|
2160
2238
|
interface AxAssertion {
|
|
2161
2239
|
fn(values: Record<string, unknown>): Promise<boolean | undefined> | boolean | undefined;
|
|
2162
2240
|
message?: string;
|
|
@@ -2179,63 +2257,23 @@ declare class AxAssertionError extends Error {
|
|
|
2179
2257
|
}
|
|
2180
2258
|
|
|
2181
2259
|
declare class AxMemory implements AxAIMemory {
|
|
2182
|
-
private limit;
|
|
2183
2260
|
private options?;
|
|
2184
2261
|
private memories;
|
|
2185
2262
|
private defaultMemory;
|
|
2186
|
-
constructor(
|
|
2263
|
+
constructor(options?: {
|
|
2187
2264
|
debug?: boolean;
|
|
2188
2265
|
debugHideSystemPrompt?: boolean;
|
|
2189
2266
|
} | undefined);
|
|
2190
2267
|
private getMemory;
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2268
|
+
addRequest(value: AxChatRequest['chatPrompt'], sessionId?: string): void;
|
|
2269
|
+
addResponse(results: Readonly<AxChatResponseResult[]>, sessionId?: string): void;
|
|
2270
|
+
addFunctionResults(results: Readonly<AxFunctionResult[]>, sessionId?: string): void;
|
|
2271
|
+
updateResult(result: Readonly<AxChatResponseResult & {
|
|
2272
|
+
delta?: string;
|
|
2273
|
+
}>, sessionId?: string): void;
|
|
2194
2274
|
addTag(name: string, sessionId?: string): void;
|
|
2195
|
-
rewindToTag(name: string, sessionId?: string):
|
|
2196
|
-
|
|
2197
|
-
content: string;
|
|
2198
|
-
cache?: boolean;
|
|
2199
|
-
} | {
|
|
2200
|
-
role: "user";
|
|
2201
|
-
name?: string;
|
|
2202
|
-
content: string | ({
|
|
2203
|
-
type: "text";
|
|
2204
|
-
text: string;
|
|
2205
|
-
cache?: boolean;
|
|
2206
|
-
} | {
|
|
2207
|
-
type: "image";
|
|
2208
|
-
mimeType: string;
|
|
2209
|
-
image: string;
|
|
2210
|
-
details?: "high" | "low" | "auto";
|
|
2211
|
-
cache?: boolean;
|
|
2212
|
-
} | {
|
|
2213
|
-
type: "audio";
|
|
2214
|
-
data: string;
|
|
2215
|
-
format?: "wav";
|
|
2216
|
-
cache?: boolean;
|
|
2217
|
-
})[];
|
|
2218
|
-
} | {
|
|
2219
|
-
role: "assistant";
|
|
2220
|
-
content?: string;
|
|
2221
|
-
name?: string;
|
|
2222
|
-
functionCalls?: {
|
|
2223
|
-
id: string;
|
|
2224
|
-
type: "function";
|
|
2225
|
-
function: {
|
|
2226
|
-
name: string;
|
|
2227
|
-
params?: string | object;
|
|
2228
|
-
};
|
|
2229
|
-
}[];
|
|
2230
|
-
cache?: boolean;
|
|
2231
|
-
} | {
|
|
2232
|
-
role: "function";
|
|
2233
|
-
result: string;
|
|
2234
|
-
isError?: boolean;
|
|
2235
|
-
functionId: string;
|
|
2236
|
-
cache?: boolean;
|
|
2237
|
-
})[];
|
|
2238
|
-
history(sessionId?: string): ({
|
|
2275
|
+
rewindToTag(name: string, sessionId?: string): AxMemoryData;
|
|
2276
|
+
history(index: number, sessionId?: string): ({
|
|
2239
2277
|
role: "system";
|
|
2240
2278
|
content: string;
|
|
2241
2279
|
cache?: boolean;
|
|
@@ -2279,8 +2317,12 @@ declare class AxMemory implements AxAIMemory {
|
|
|
2279
2317
|
cache?: boolean;
|
|
2280
2318
|
})[];
|
|
2281
2319
|
getLast(sessionId?: string): {
|
|
2282
|
-
chat: AxChatRequest["chatPrompt"][number];
|
|
2283
2320
|
tags?: string[];
|
|
2321
|
+
role: AxChatRequest["chatPrompt"][number]["role"];
|
|
2322
|
+
chat: {
|
|
2323
|
+
index: number;
|
|
2324
|
+
value: Omit<AxChatRequest["chatPrompt"][number], "role">;
|
|
2325
|
+
}[];
|
|
2284
2326
|
} | undefined;
|
|
2285
2327
|
reset(sessionId?: string): void;
|
|
2286
2328
|
}
|
|
@@ -2312,33 +2354,6 @@ type AxInputFunctionType = (AxFunction | {
|
|
|
2312
2354
|
toFunction: () => AxFunction | AxFunction[];
|
|
2313
2355
|
})[];
|
|
2314
2356
|
|
|
2315
|
-
type AxFieldValue = string | string[] | number | boolean | object | null | undefined | {
|
|
2316
|
-
mimeType: string;
|
|
2317
|
-
data: string;
|
|
2318
|
-
} | {
|
|
2319
|
-
mimeType: string;
|
|
2320
|
-
data: string;
|
|
2321
|
-
}[] | {
|
|
2322
|
-
format?: 'wav';
|
|
2323
|
-
data: string;
|
|
2324
|
-
} | {
|
|
2325
|
-
format?: 'wav';
|
|
2326
|
-
data: string;
|
|
2327
|
-
}[];
|
|
2328
|
-
type AxGenIn = {
|
|
2329
|
-
[key: string]: AxFieldValue;
|
|
2330
|
-
};
|
|
2331
|
-
type AxGenOut = {
|
|
2332
|
-
[key: string]: AxFieldValue;
|
|
2333
|
-
};
|
|
2334
|
-
type AxMessage<IN extends AxGenIn> = {
|
|
2335
|
-
role: 'user';
|
|
2336
|
-
values: IN;
|
|
2337
|
-
} | {
|
|
2338
|
-
role: 'assistant';
|
|
2339
|
-
values: IN;
|
|
2340
|
-
};
|
|
2341
|
-
|
|
2342
2357
|
type Writeable<T> = {
|
|
2343
2358
|
-readonly [P in keyof T]: T[P];
|
|
2344
2359
|
};
|
|
@@ -2364,7 +2379,9 @@ declare class AxPromptTemplate {
|
|
|
2364
2379
|
skipSystemPrompt?: boolean;
|
|
2365
2380
|
examples?: Record<string, AxFieldValue>[];
|
|
2366
2381
|
demos?: Record<string, AxFieldValue>[];
|
|
2367
|
-
}>) => AxChatRequest["chatPrompt"]
|
|
2382
|
+
}>) => Extract<AxChatRequest["chatPrompt"][number], {
|
|
2383
|
+
role: "user" | "system" | "assistant";
|
|
2384
|
+
}>[];
|
|
2368
2385
|
renderExtraFields: (extraFields: readonly AxIField[]) => ({
|
|
2369
2386
|
type: "text";
|
|
2370
2387
|
text: string;
|
|
@@ -2397,6 +2414,25 @@ type AxProgramDemos<IN extends AxGenIn, OUT extends AxGenOut> = {
|
|
|
2397
2414
|
programId: string;
|
|
2398
2415
|
};
|
|
2399
2416
|
type AxProgramExamples<IN extends AxGenIn, OUT extends AxGenOut> = AxProgramDemos<IN, OUT> | AxProgramDemos<IN, OUT>['traces'];
|
|
2417
|
+
type AxResultPickerFunctionFieldResults<OUT extends AxGenOut> = {
|
|
2418
|
+
type: 'fields';
|
|
2419
|
+
results: readonly {
|
|
2420
|
+
index: number;
|
|
2421
|
+
sample: Partial<OUT>;
|
|
2422
|
+
}[];
|
|
2423
|
+
};
|
|
2424
|
+
type AxResultPickerFunctionFunctionResults = {
|
|
2425
|
+
type: 'function';
|
|
2426
|
+
results: readonly {
|
|
2427
|
+
index: number;
|
|
2428
|
+
functionName: string;
|
|
2429
|
+
functionId: string;
|
|
2430
|
+
args: string | object;
|
|
2431
|
+
result: string;
|
|
2432
|
+
isError?: boolean;
|
|
2433
|
+
}[];
|
|
2434
|
+
};
|
|
2435
|
+
type AxResultPickerFunction<OUT extends AxGenOut> = (data: AxResultPickerFunctionFieldResults<OUT> | AxResultPickerFunctionFunctionResults) => number | Promise<number>;
|
|
2400
2436
|
type AxProgramForwardOptions = {
|
|
2401
2437
|
maxRetries?: number;
|
|
2402
2438
|
maxSteps?: number;
|
|
@@ -2409,6 +2445,8 @@ type AxProgramForwardOptions = {
|
|
|
2409
2445
|
tracer?: Tracer;
|
|
2410
2446
|
rateLimiter?: AxRateLimiterFunction;
|
|
2411
2447
|
stream?: boolean;
|
|
2448
|
+
sampleCount?: number;
|
|
2449
|
+
resultPicker?: AxResultPickerFunction<AxGenOut>;
|
|
2412
2450
|
functions?: AxInputFunctionType;
|
|
2413
2451
|
functionCall?: AxChatRequest['functionCall'];
|
|
2414
2452
|
stopFunction?: string;
|
|
@@ -2431,9 +2469,10 @@ type AxProgramForwardOptions = {
|
|
|
2431
2469
|
type AxProgramStreamingForwardOptions = Omit<AxProgramForwardOptions, 'stream'>;
|
|
2432
2470
|
type AxGenDeltaOut<OUT extends AxGenOut> = {
|
|
2433
2471
|
version: number;
|
|
2472
|
+
index: number;
|
|
2434
2473
|
delta: Partial<OUT>;
|
|
2435
2474
|
};
|
|
2436
|
-
type AxGenStreamingOut<OUT extends AxGenOut> = AsyncGenerator<AxGenDeltaOut<OUT>, void
|
|
2475
|
+
type AxGenStreamingOut<OUT extends AxGenOut> = AsyncGenerator<AxGenDeltaOut<OUT>, void, unknown>;
|
|
2437
2476
|
type AxSetExamplesOptions = {};
|
|
2438
2477
|
interface AxTunable<IN extends AxGenIn, OUT extends AxGenOut> {
|
|
2439
2478
|
setExamples: (examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>) => void;
|
|
@@ -3271,109 +3310,6 @@ declare class AxDBManager {
|
|
|
3271
3310
|
}> | undefined) => Promise<AxDBMatch[][]>;
|
|
3272
3311
|
}
|
|
3273
3312
|
|
|
3274
|
-
type AxFieldProcessorProcess = (value: AxFieldValue, context?: Readonly<{
|
|
3275
|
-
values?: AxGenOut;
|
|
3276
|
-
sessionId?: string;
|
|
3277
|
-
done?: boolean;
|
|
3278
|
-
}>) => unknown | Promise<unknown>;
|
|
3279
|
-
type AxStreamingFieldProcessorProcess = (value: string, context?: Readonly<{
|
|
3280
|
-
values?: AxGenOut;
|
|
3281
|
-
sessionId?: string;
|
|
3282
|
-
done?: boolean;
|
|
3283
|
-
}>) => unknown | Promise<unknown>;
|
|
3284
|
-
interface AxFieldProcessor {
|
|
3285
|
-
field: Readonly<AxField>;
|
|
3286
|
-
/**
|
|
3287
|
-
* Process the field value and return a new value (or undefined if no update is needed).
|
|
3288
|
-
* The returned value may be merged back into memory.
|
|
3289
|
-
* @param value - The current field value.
|
|
3290
|
-
* @param context - Additional context (e.g. memory and session id).
|
|
3291
|
-
*/
|
|
3292
|
-
process: AxFieldProcessorProcess | AxStreamingFieldProcessorProcess;
|
|
3293
|
-
}
|
|
3294
|
-
|
|
3295
|
-
type AxGenerateResult<OUT extends AxGenOut> = OUT & {
|
|
3296
|
-
thought?: string;
|
|
3297
|
-
};
|
|
3298
|
-
interface AxResponseHandlerArgs<T> {
|
|
3299
|
-
ai: Readonly<AxAIService>;
|
|
3300
|
-
model?: string;
|
|
3301
|
-
res: T;
|
|
3302
|
-
mem: AxAIMemory;
|
|
3303
|
-
sessionId?: string;
|
|
3304
|
-
traceId?: string;
|
|
3305
|
-
functions?: Readonly<AxFunction[]>;
|
|
3306
|
-
strictMode?: boolean;
|
|
3307
|
-
span?: Span;
|
|
3308
|
-
}
|
|
3309
|
-
interface AxStreamingEvent<T> {
|
|
3310
|
-
event: 'delta' | 'done' | 'error';
|
|
3311
|
-
data: {
|
|
3312
|
-
contentDelta?: string;
|
|
3313
|
-
partialValues?: Partial<T>;
|
|
3314
|
-
error?: string;
|
|
3315
|
-
functions?: AxChatResponseFunctionCall[];
|
|
3316
|
-
};
|
|
3317
|
-
}
|
|
3318
|
-
declare class AxGen<IN extends AxGenIn, OUT extends AxGenerateResult<AxGenOut> = AxGenerateResult<AxGenOut>> extends AxProgramWithSignature<IN, OUT> {
|
|
3319
|
-
private promptTemplate;
|
|
3320
|
-
private asserts;
|
|
3321
|
-
private streamingAsserts;
|
|
3322
|
-
private options?;
|
|
3323
|
-
private functions?;
|
|
3324
|
-
private functionsExecuted;
|
|
3325
|
-
private fieldProcessors;
|
|
3326
|
-
private streamingFieldProcessors;
|
|
3327
|
-
private values;
|
|
3328
|
-
private excludeContentFromTrace;
|
|
3329
|
-
private thoughtFieldName;
|
|
3330
|
-
constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>, options?: Readonly<AxProgramForwardOptions>);
|
|
3331
|
-
addAssert: (fn: AxAssertion["fn"], message?: string) => void;
|
|
3332
|
-
addStreamingAssert: (fieldName: string, fn: AxStreamingAssertion["fn"], message?: string) => void;
|
|
3333
|
-
private addFieldProcessorInternal;
|
|
3334
|
-
addStreamingFieldProcessor: (fieldName: string, fn: AxFieldProcessor["process"]) => void;
|
|
3335
|
-
addFieldProcessor: (fieldName: string, fn: AxFieldProcessor["process"]) => void;
|
|
3336
|
-
private forwardSendRequest;
|
|
3337
|
-
private forwardCore;
|
|
3338
|
-
private processStreamingResponse;
|
|
3339
|
-
private processResponse;
|
|
3340
|
-
private _forward2;
|
|
3341
|
-
private shouldContinueSteps;
|
|
3342
|
-
_forward1(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options: Readonly<AxProgramForwardOptions>): AsyncGenerator<{
|
|
3343
|
-
version: number;
|
|
3344
|
-
delta: Partial<OUT>;
|
|
3345
|
-
}, void, unknown>;
|
|
3346
|
-
forward(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;
|
|
3347
|
-
streamingForward(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptions>): AsyncGenerator<{
|
|
3348
|
-
version: number;
|
|
3349
|
-
delta: Partial<OUT>;
|
|
3350
|
-
}, void, unknown>;
|
|
3351
|
-
setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;
|
|
3352
|
-
private isDebug;
|
|
3353
|
-
private getLogger;
|
|
3354
|
-
}
|
|
3355
|
-
type AxGenerateErrorDetails = {
|
|
3356
|
-
model?: string;
|
|
3357
|
-
maxTokens?: number;
|
|
3358
|
-
streaming: boolean;
|
|
3359
|
-
signature: {
|
|
3360
|
-
input: Readonly<AxIField[]>;
|
|
3361
|
-
output: Readonly<AxIField[]>;
|
|
3362
|
-
description?: string;
|
|
3363
|
-
};
|
|
3364
|
-
};
|
|
3365
|
-
declare class AxGenerateError extends Error {
|
|
3366
|
-
readonly details: AxGenerateErrorDetails;
|
|
3367
|
-
constructor(message: string, details: Readonly<AxGenerateErrorDetails>, options?: ErrorOptions);
|
|
3368
|
-
}
|
|
3369
|
-
|
|
3370
|
-
declare class AxDefaultQueryRewriter extends AxGen<AxRewriteIn, AxRewriteOut> {
|
|
3371
|
-
constructor(options?: Readonly<AxProgramForwardOptions>);
|
|
3372
|
-
}
|
|
3373
|
-
declare class AxRewriter extends AxGen<AxRewriteIn, AxRewriteOut> {
|
|
3374
|
-
constructor(options?: Readonly<AxProgramForwardOptions>);
|
|
3375
|
-
}
|
|
3376
|
-
|
|
3377
3313
|
interface AxDockerContainer {
|
|
3378
3314
|
Id: string;
|
|
3379
3315
|
Names: string[];
|
|
@@ -3475,6 +3411,95 @@ declare class AxDockerSession {
|
|
|
3475
3411
|
toFunction(): AxFunction;
|
|
3476
3412
|
}
|
|
3477
3413
|
|
|
3414
|
+
type AxFieldProcessorProcess = (value: AxFieldValue, context?: Readonly<{
|
|
3415
|
+
values?: AxGenOut;
|
|
3416
|
+
sessionId?: string;
|
|
3417
|
+
done?: boolean;
|
|
3418
|
+
}>) => unknown | Promise<unknown>;
|
|
3419
|
+
type AxStreamingFieldProcessorProcess = (value: string, context?: Readonly<{
|
|
3420
|
+
values?: AxGenOut;
|
|
3421
|
+
sessionId?: string;
|
|
3422
|
+
done?: boolean;
|
|
3423
|
+
}>) => unknown | Promise<unknown>;
|
|
3424
|
+
interface AxFieldProcessor {
|
|
3425
|
+
field: Readonly<AxField>;
|
|
3426
|
+
/**
|
|
3427
|
+
* Process the field value and return a new value (or undefined if no update is needed).
|
|
3428
|
+
* The returned value may be merged back into memory.
|
|
3429
|
+
* @param value - The current field value.
|
|
3430
|
+
* @param context - Additional context (e.g. memory and session id).
|
|
3431
|
+
*/
|
|
3432
|
+
process: AxFieldProcessorProcess | AxStreamingFieldProcessorProcess;
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
type AxGenerateResult<OUT extends AxGenOut> = OUT & {
|
|
3436
|
+
thought?: string;
|
|
3437
|
+
};
|
|
3438
|
+
interface AxResponseHandlerArgs<T> {
|
|
3439
|
+
ai: Readonly<AxAIService>;
|
|
3440
|
+
model?: string;
|
|
3441
|
+
res: T;
|
|
3442
|
+
mem: AxAIMemory;
|
|
3443
|
+
sessionId?: string;
|
|
3444
|
+
traceId?: string;
|
|
3445
|
+
functions: Readonly<AxFunction[]>;
|
|
3446
|
+
strictMode?: boolean;
|
|
3447
|
+
span?: Span;
|
|
3448
|
+
}
|
|
3449
|
+
interface AxStreamingEvent<T> {
|
|
3450
|
+
event: 'delta' | 'done' | 'error';
|
|
3451
|
+
data: {
|
|
3452
|
+
contentDelta?: string;
|
|
3453
|
+
partialValues?: Partial<T>;
|
|
3454
|
+
error?: string;
|
|
3455
|
+
functions?: AxChatResponseFunctionCall[];
|
|
3456
|
+
};
|
|
3457
|
+
}
|
|
3458
|
+
declare class AxGen<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxProgramWithSignature<IN, OUT> {
|
|
3459
|
+
private promptTemplate;
|
|
3460
|
+
private asserts;
|
|
3461
|
+
private streamingAsserts;
|
|
3462
|
+
private options?;
|
|
3463
|
+
private functions?;
|
|
3464
|
+
private fieldProcessors;
|
|
3465
|
+
private streamingFieldProcessors;
|
|
3466
|
+
private excludeContentFromTrace;
|
|
3467
|
+
private thoughtFieldName;
|
|
3468
|
+
constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>, options?: Readonly<AxProgramForwardOptions>);
|
|
3469
|
+
private createStates;
|
|
3470
|
+
addAssert: (fn: AxAssertion["fn"], message?: string) => void;
|
|
3471
|
+
addStreamingAssert: (fieldName: string, fn: AxStreamingAssertion["fn"], message?: string) => void;
|
|
3472
|
+
private addFieldProcessorInternal;
|
|
3473
|
+
addStreamingFieldProcessor: (fieldName: string, fn: AxFieldProcessor["process"]) => void;
|
|
3474
|
+
addFieldProcessor: (fieldName: string, fn: AxFieldProcessor["process"]) => void;
|
|
3475
|
+
private forwardSendRequest;
|
|
3476
|
+
private forwardCore;
|
|
3477
|
+
private _forward2;
|
|
3478
|
+
_forward1(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options: Readonly<AxProgramForwardOptions>): AxGenStreamingOut<OUT>;
|
|
3479
|
+
forward(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;
|
|
3480
|
+
streamingForward(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;
|
|
3481
|
+
setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;
|
|
3482
|
+
private isDebug;
|
|
3483
|
+
private getLogger;
|
|
3484
|
+
}
|
|
3485
|
+
type AxGenerateErrorDetails = {
|
|
3486
|
+
model?: string;
|
|
3487
|
+
maxTokens?: number;
|
|
3488
|
+
streaming: boolean;
|
|
3489
|
+
signature: {
|
|
3490
|
+
input: Readonly<AxIField[]>;
|
|
3491
|
+
output: Readonly<AxIField[]>;
|
|
3492
|
+
description?: string;
|
|
3493
|
+
};
|
|
3494
|
+
};
|
|
3495
|
+
type ErrorOptions = {
|
|
3496
|
+
cause?: Error;
|
|
3497
|
+
};
|
|
3498
|
+
declare class AxGenerateError extends Error {
|
|
3499
|
+
readonly details: AxGenerateErrorDetails;
|
|
3500
|
+
constructor(message: string, details: Readonly<AxGenerateErrorDetails>, options?: ErrorOptions);
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3478
3503
|
type AxDataRow = {
|
|
3479
3504
|
row: Record<string, AxFieldValue>;
|
|
3480
3505
|
};
|
|
@@ -3934,6 +3959,20 @@ declare const axCreateOptimizerLogger: (output?: (message: string) => void) => A
|
|
|
3934
3959
|
*/
|
|
3935
3960
|
declare const axDefaultOptimizerLogger: AxLoggerFunction;
|
|
3936
3961
|
|
|
3962
|
+
type AxChatRequestMessage = AxChatRequest['chatPrompt'][number];
|
|
3963
|
+
/**
|
|
3964
|
+
* Validates a chat request message item to ensure it meets the required criteria
|
|
3965
|
+
* @param item - The chat request message to validate
|
|
3966
|
+
* @throws {Error} When validation fails with a descriptive error message
|
|
3967
|
+
*/
|
|
3968
|
+
declare function axValidateChatRequestMessage(item: AxChatRequestMessage): void;
|
|
3969
|
+
/**
|
|
3970
|
+
* Validates a chat response result to ensure it meets the required criteria
|
|
3971
|
+
* @param results - The chat response results to validate (single result or array)
|
|
3972
|
+
* @throws {Error} When validation fails with a descriptive error message
|
|
3973
|
+
*/
|
|
3974
|
+
declare function axValidateChatResponseResult(results: Readonly<AxChatResponseResult[]> | Readonly<AxChatResponseResult>): void;
|
|
3975
|
+
|
|
3937
3976
|
declare class AxAIOpenAIResponsesImpl<TModel, TEmbedModel, // Kept for interface compatibility, but not used by this impl.
|
|
3938
3977
|
TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>> implements AxAIServiceImpl<TModel, TEmbedModel, Readonly<AxAIOpenAIResponsesRequest<TModel>>, // ChatReq (now ResponsesReq)
|
|
3939
3978
|
Readonly<AxAIOpenAIEmbedRequest<TEmbedModel>>, // EmbedReq
|
|
@@ -4273,4 +4312,8 @@ declare const axModelInfoReka: AxModelInfo[];
|
|
|
4273
4312
|
|
|
4274
4313
|
declare const axModelInfoTogether: AxModelInfo[];
|
|
4275
4314
|
|
|
4276
|
-
export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, AxAIAnthropicVertexModel, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingTokenBudgetLevels, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, AxAIOpenAIResponsesModel, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, type AxBootstrapCompileOptions, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCompileOptions, type AxCostTracker, type AxCostTrackerOptions, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, AxDefaultCostTracker, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldDescriptor, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, type AxLoggerFunction, type AxLoggerTag, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROCompileOptions, type AxMiPROOptimizerOptions, type AxMiPROResult, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, AxMultiServiceRouter, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerResult, type AxParetoResult, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, type AxPromptTemplateOptions, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxRewriter, type AxSetExamplesOptions, AxSignature, type AxSignatureConfig, type AxSignatureTemplateValue, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, ax, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axCreateDefaultLogger, axCreateDefaultTextLogger, axCreateOptimizerLogger, axDefaultOptimizerLogger, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, f, s };
|
|
4315
|
+
interface AxSamplePickerOptions<OUT extends AxGenOut> {
|
|
4316
|
+
resultPicker?: AxResultPickerFunction<OUT>;
|
|
4317
|
+
}
|
|
4318
|
+
|
|
4319
|
+
export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, AxAIAnthropicVertexModel, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingTokenBudgetLevels, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, AxAIOpenAIResponsesModel, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, type AxBootstrapCompileOptions, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCompileOptions, type AxCostTracker, type AxCostTrackerOptions, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, AxDefaultCostTracker, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldDescriptor, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, type AxLoggerFunction, type AxLoggerTag, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMemoryData, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROCompileOptions, type AxMiPROOptimizerOptions, type AxMiPROResult, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, AxMultiServiceRouter, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerResult, type AxParetoResult, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, type AxPromptTemplateOptions, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxSamplePickerOptions, type AxSetExamplesOptions, AxSignature, type AxSignatureConfig, type AxSignatureTemplateValue, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, ax, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axCreateDefaultLogger, axCreateDefaultTextLogger, axCreateOptimizerLogger, axDefaultOptimizerLogger, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, axValidateChatRequestMessage, axValidateChatResponseResult, f, s };
|