@ax-llm/ax 11.0.15 → 11.0.17
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 +527 -250
- package/index.cjs.map +1 -1
- package/index.d.cts +136 -19
- package/index.d.ts +136 -19
- package/index.js +529 -252
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -36,7 +36,6 @@ declare class AxAIServiceError extends Error {
|
|
|
36
36
|
readonly context: Record<string, unknown>;
|
|
37
37
|
constructor(message: string, url: string, requestBody?: unknown | undefined, context?: Record<string, unknown>);
|
|
38
38
|
toString(): string;
|
|
39
|
-
toJSON(): Record<string, unknown>;
|
|
40
39
|
}
|
|
41
40
|
declare class AxAIServiceStatusError extends AxAIServiceError {
|
|
42
41
|
readonly status: number;
|
|
@@ -94,6 +93,8 @@ type AxModelConfig = {
|
|
|
94
93
|
type AxFunctionHandler = (args?: any, extra?: Readonly<{
|
|
95
94
|
sessionId?: string;
|
|
96
95
|
traceId?: string;
|
|
96
|
+
debug?: boolean;
|
|
97
|
+
ai?: AxAIService;
|
|
97
98
|
}>) => unknown;
|
|
98
99
|
type AxFunctionJSONSchema = {
|
|
99
100
|
type: string;
|
|
@@ -141,7 +142,7 @@ type AxModelInfoWithProvider = AxModelInfo & {
|
|
|
141
142
|
provider: string;
|
|
142
143
|
};
|
|
143
144
|
type AxChatRequest<TModel = string> = {
|
|
144
|
-
chatPrompt:
|
|
145
|
+
chatPrompt: ({
|
|
145
146
|
role: 'system';
|
|
146
147
|
content: string;
|
|
147
148
|
cache?: boolean;
|
|
@@ -183,7 +184,7 @@ type AxChatRequest<TModel = string> = {
|
|
|
183
184
|
isError?: boolean;
|
|
184
185
|
functionId: string;
|
|
185
186
|
cache?: boolean;
|
|
186
|
-
}
|
|
187
|
+
})[];
|
|
187
188
|
functions?: Readonly<{
|
|
188
189
|
name: string;
|
|
189
190
|
description: string;
|
|
@@ -195,7 +196,7 @@ type AxChatRequest<TModel = string> = {
|
|
|
195
196
|
name: string;
|
|
196
197
|
};
|
|
197
198
|
};
|
|
198
|
-
modelConfig?:
|
|
199
|
+
modelConfig?: AxModelConfig;
|
|
199
200
|
model?: TModel;
|
|
200
201
|
};
|
|
201
202
|
interface AxAIServiceMetrics {
|
|
@@ -250,6 +251,7 @@ type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown> = {
|
|
|
250
251
|
sessionId?: string;
|
|
251
252
|
traceId?: string;
|
|
252
253
|
rateLimiter?: AxRateLimiterFunction;
|
|
254
|
+
debug?: boolean;
|
|
253
255
|
};
|
|
254
256
|
interface AxAIService<TModel = unknown, TEmbedModel = unknown> {
|
|
255
257
|
getId(): string;
|
|
@@ -1064,6 +1066,7 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1064
1066
|
apiKey?: string;
|
|
1065
1067
|
projectId?: string;
|
|
1066
1068
|
region?: string;
|
|
1069
|
+
endpoint?: string;
|
|
1067
1070
|
config?: Readonly<Partial<AxAIGoogleGeminiConfig>>;
|
|
1068
1071
|
options?: Readonly<AxAIServiceOptions & AxAIGoogleGeminiOptionsTools>;
|
|
1069
1072
|
models?: AxAIModelList<AxAIGoogleGeminiModel>;
|
|
@@ -1072,7 +1075,7 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1072
1075
|
* AxAIGoogleGemini: AI Service
|
|
1073
1076
|
*/
|
|
1074
1077
|
declare class AxAIGoogleGemini extends AxBaseAI<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiChatRequest, AxAIGoogleGeminiBatchEmbedRequest | AxAIGoogleVertexBatchEmbedRequest, AxAIGoogleGeminiChatResponse, AxAIGoogleGeminiChatResponseDelta, AxAIGoogleGeminiBatchEmbedResponse | AxAIGoogleVertexBatchEmbedResponse> {
|
|
1075
|
-
constructor({ apiKey, projectId, region, config, options, models, }: Readonly<Omit<AxAIGoogleGeminiArgs, 'name'>>);
|
|
1078
|
+
constructor({ apiKey, projectId, region, endpoint, config, options, models, }: Readonly<Omit<AxAIGoogleGeminiArgs, 'name'>>);
|
|
1076
1079
|
}
|
|
1077
1080
|
|
|
1078
1081
|
declare enum AxAIGroqModel {
|
|
@@ -1284,12 +1287,17 @@ declare class AxAI implements AxAIService {
|
|
|
1284
1287
|
}
|
|
1285
1288
|
|
|
1286
1289
|
interface AxAIMemory {
|
|
1287
|
-
add(result: Readonly<AxChatRequest['chatPrompt'] | AxChatRequest['chatPrompt'][
|
|
1290
|
+
add(result: Readonly<AxChatRequest['chatPrompt']> | Readonly<AxChatRequest['chatPrompt'][number]>, sessionId?: string): void;
|
|
1288
1291
|
addResult(result: Readonly<AxChatResponseResult>, sessionId?: string): void;
|
|
1289
|
-
updateResult(result: Readonly<AxChatResponseResult
|
|
1292
|
+
updateResult(result: Readonly<AxChatResponseResult> & {
|
|
1293
|
+
delta?: string;
|
|
1294
|
+
}, sessionId?: string): void;
|
|
1290
1295
|
history(sessionId?: string): AxChatRequest['chatPrompt'];
|
|
1291
1296
|
reset(sessionId?: string): void;
|
|
1292
|
-
getLast(sessionId?: string):
|
|
1297
|
+
getLast(sessionId?: string): {
|
|
1298
|
+
chat: AxChatRequest['chatPrompt'][number];
|
|
1299
|
+
tags?: string[];
|
|
1300
|
+
} | undefined;
|
|
1293
1301
|
addTag(name: string, sessionId?: string): void;
|
|
1294
1302
|
rewindToTag(name: string, sessionId?: string): AxChatRequest['chatPrompt'];
|
|
1295
1303
|
}
|
|
@@ -1299,7 +1307,7 @@ interface AxField {
|
|
|
1299
1307
|
title?: string;
|
|
1300
1308
|
description?: string;
|
|
1301
1309
|
type?: {
|
|
1302
|
-
name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'date' | 'datetime' | 'class';
|
|
1310
|
+
name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'date' | 'datetime' | 'class' | 'code';
|
|
1303
1311
|
isArray: boolean;
|
|
1304
1312
|
classes?: string[];
|
|
1305
1313
|
};
|
|
@@ -1374,7 +1382,8 @@ type AxProgramForwardOptions = {
|
|
|
1374
1382
|
functions?: AxFunction[];
|
|
1375
1383
|
functionCall?: AxChatRequest['functionCall'];
|
|
1376
1384
|
stopFunction?: string;
|
|
1377
|
-
|
|
1385
|
+
fastFail?: boolean;
|
|
1386
|
+
debug?: boolean;
|
|
1378
1387
|
};
|
|
1379
1388
|
type AxProgramStreamingForwardOptions = Omit<AxProgramForwardOptions, 'stream'>;
|
|
1380
1389
|
type AxGenDeltaOut<OUT> = {
|
|
@@ -1461,19 +1470,122 @@ declare class AxAssertionError extends Error {
|
|
|
1461
1470
|
}[];
|
|
1462
1471
|
}
|
|
1463
1472
|
|
|
1473
|
+
interface AxFieldProcessor {
|
|
1474
|
+
field: Readonly<AxField>;
|
|
1475
|
+
/**
|
|
1476
|
+
* Process the field value and return a new value (or undefined if no update is needed).
|
|
1477
|
+
* The returned value may be merged back into memory.
|
|
1478
|
+
* @param value - The current field value.
|
|
1479
|
+
* @param context - Additional context (e.g. memory and session id).
|
|
1480
|
+
*/
|
|
1481
|
+
process: (value: AxFieldValue, context?: Readonly<{
|
|
1482
|
+
values?: AxGenOut;
|
|
1483
|
+
sessionId?: string;
|
|
1484
|
+
done?: boolean;
|
|
1485
|
+
}>) => any | Promise<any>;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1464
1488
|
declare class AxMemory implements AxAIMemory {
|
|
1465
1489
|
private limit;
|
|
1490
|
+
private debug;
|
|
1466
1491
|
private memories;
|
|
1467
1492
|
private defaultMemory;
|
|
1468
|
-
constructor(limit?: number);
|
|
1493
|
+
constructor(limit?: number, debug?: boolean);
|
|
1469
1494
|
private getMemory;
|
|
1470
|
-
add(value:
|
|
1495
|
+
add(value: AxChatRequest['chatPrompt'][number] | AxChatRequest['chatPrompt'], sessionId?: string): void;
|
|
1471
1496
|
addResult(result: Readonly<AxChatResponseResult>, sessionId?: string): void;
|
|
1472
1497
|
updateResult(result: Readonly<AxChatResponseResult>, sessionId?: string): void;
|
|
1473
1498
|
addTag(name: string, sessionId?: string): void;
|
|
1474
|
-
rewindToTag(name: string, sessionId?: string):
|
|
1475
|
-
|
|
1476
|
-
|
|
1499
|
+
rewindToTag(name: string, sessionId?: string): ({
|
|
1500
|
+
role: "system";
|
|
1501
|
+
content: string;
|
|
1502
|
+
cache?: boolean;
|
|
1503
|
+
} | {
|
|
1504
|
+
role: "user";
|
|
1505
|
+
name?: string;
|
|
1506
|
+
content: string | ({
|
|
1507
|
+
type: "text";
|
|
1508
|
+
text: string;
|
|
1509
|
+
cache?: boolean;
|
|
1510
|
+
} | {
|
|
1511
|
+
type: "image";
|
|
1512
|
+
mimeType: string;
|
|
1513
|
+
image: string;
|
|
1514
|
+
details?: "high" | "low" | "auto";
|
|
1515
|
+
cache?: boolean;
|
|
1516
|
+
} | {
|
|
1517
|
+
type: "audio";
|
|
1518
|
+
data: string;
|
|
1519
|
+
format?: "wav";
|
|
1520
|
+
cache?: boolean;
|
|
1521
|
+
})[];
|
|
1522
|
+
} | {
|
|
1523
|
+
role: "assistant";
|
|
1524
|
+
content?: string;
|
|
1525
|
+
name?: string;
|
|
1526
|
+
functionCalls?: {
|
|
1527
|
+
id: string;
|
|
1528
|
+
type: "function";
|
|
1529
|
+
function: {
|
|
1530
|
+
name: string;
|
|
1531
|
+
params?: string | object;
|
|
1532
|
+
};
|
|
1533
|
+
}[];
|
|
1534
|
+
cache?: boolean;
|
|
1535
|
+
} | {
|
|
1536
|
+
role: "function";
|
|
1537
|
+
result: string;
|
|
1538
|
+
isError?: boolean;
|
|
1539
|
+
functionId: string;
|
|
1540
|
+
cache?: boolean;
|
|
1541
|
+
})[];
|
|
1542
|
+
history(sessionId?: string): ({
|
|
1543
|
+
role: "system";
|
|
1544
|
+
content: string;
|
|
1545
|
+
cache?: boolean;
|
|
1546
|
+
} | {
|
|
1547
|
+
role: "user";
|
|
1548
|
+
name?: string;
|
|
1549
|
+
content: string | ({
|
|
1550
|
+
type: "text";
|
|
1551
|
+
text: string;
|
|
1552
|
+
cache?: boolean;
|
|
1553
|
+
} | {
|
|
1554
|
+
type: "image";
|
|
1555
|
+
mimeType: string;
|
|
1556
|
+
image: string;
|
|
1557
|
+
details?: "high" | "low" | "auto";
|
|
1558
|
+
cache?: boolean;
|
|
1559
|
+
} | {
|
|
1560
|
+
type: "audio";
|
|
1561
|
+
data: string;
|
|
1562
|
+
format?: "wav";
|
|
1563
|
+
cache?: boolean;
|
|
1564
|
+
})[];
|
|
1565
|
+
} | {
|
|
1566
|
+
role: "assistant";
|
|
1567
|
+
content?: string;
|
|
1568
|
+
name?: string;
|
|
1569
|
+
functionCalls?: {
|
|
1570
|
+
id: string;
|
|
1571
|
+
type: "function";
|
|
1572
|
+
function: {
|
|
1573
|
+
name: string;
|
|
1574
|
+
params?: string | object;
|
|
1575
|
+
};
|
|
1576
|
+
}[];
|
|
1577
|
+
cache?: boolean;
|
|
1578
|
+
} | {
|
|
1579
|
+
role: "function";
|
|
1580
|
+
result: string;
|
|
1581
|
+
isError?: boolean;
|
|
1582
|
+
functionId: string;
|
|
1583
|
+
cache?: boolean;
|
|
1584
|
+
})[];
|
|
1585
|
+
getLast(sessionId?: string): {
|
|
1586
|
+
chat: AxChatRequest["chatPrompt"][number];
|
|
1587
|
+
tags?: string[];
|
|
1588
|
+
} | undefined;
|
|
1477
1589
|
reset(sessionId?: string): void;
|
|
1478
1590
|
}
|
|
1479
1591
|
|
|
@@ -1542,8 +1654,6 @@ declare class AxPromptTemplate {
|
|
|
1542
1654
|
private renderInputFields;
|
|
1543
1655
|
private renderInField;
|
|
1544
1656
|
private defaultRenderInField;
|
|
1545
|
-
private renderDescFields;
|
|
1546
|
-
private renderFields;
|
|
1547
1657
|
}
|
|
1548
1658
|
|
|
1549
1659
|
interface AxGenOptions {
|
|
@@ -1561,6 +1671,7 @@ interface AxGenOptions {
|
|
|
1561
1671
|
promptTemplate?: typeof AxPromptTemplate;
|
|
1562
1672
|
asserts?: AxAssertion[];
|
|
1563
1673
|
streamingAsserts?: AxStreamingAssertion[];
|
|
1674
|
+
fastFail?: boolean;
|
|
1564
1675
|
}
|
|
1565
1676
|
type AxGenerateResult<OUT extends AxGenOut> = OUT & {
|
|
1566
1677
|
functions?: AxChatResponseFunctionCall[];
|
|
@@ -1577,7 +1688,7 @@ interface AxResponseHandlerArgs<T> {
|
|
|
1577
1688
|
sessionId?: string;
|
|
1578
1689
|
traceId?: string;
|
|
1579
1690
|
functions?: Readonly<AxFunction[]>;
|
|
1580
|
-
|
|
1691
|
+
fastFail?: boolean;
|
|
1581
1692
|
}
|
|
1582
1693
|
interface AxStreamingEvent<T> {
|
|
1583
1694
|
event: 'delta' | 'done' | 'error';
|
|
@@ -1595,9 +1706,12 @@ declare class AxGen<IN extends AxGenIn = AxGenIn, OUT extends AxGenerateResult<A
|
|
|
1595
1706
|
private options?;
|
|
1596
1707
|
private functions?;
|
|
1597
1708
|
private functionsExecuted;
|
|
1709
|
+
private fieldProcessors;
|
|
1710
|
+
private streamingFieldProcessors;
|
|
1598
1711
|
constructor(signature: Readonly<AxSignature | string>, options?: Readonly<AxGenOptions>);
|
|
1599
1712
|
addAssert: (fn: AxAssertion["fn"], message?: string) => void;
|
|
1600
1713
|
addStreamingAssert: (fieldName: string, fn: AxStreamingAssertion["fn"], message?: string) => void;
|
|
1714
|
+
addFieldProcessor: (fieldName: string, fn: AxFieldProcessor["process"], streaming?: boolean) => void;
|
|
1601
1715
|
private forwardSendRequest;
|
|
1602
1716
|
private forwardCore;
|
|
1603
1717
|
private processStreamingResponse;
|
|
@@ -1627,6 +1741,7 @@ type AxAgentOptions = Omit<AxGenOptions, 'functions'> & {
|
|
|
1627
1741
|
disableSmartModelRouting?: boolean;
|
|
1628
1742
|
/** List of field names that should not be automatically passed from parent to child agents */
|
|
1629
1743
|
excludeFieldsFromPassthrough?: string[];
|
|
1744
|
+
debug?: boolean;
|
|
1630
1745
|
};
|
|
1631
1746
|
interface AxAgentFeatures {
|
|
1632
1747
|
/** Whether this agent can use smart model routing (requires an AI service) */
|
|
@@ -1645,6 +1760,7 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut = AxGenOut> imple
|
|
|
1645
1760
|
private agents?;
|
|
1646
1761
|
private disableSmartModelRouting?;
|
|
1647
1762
|
private excludeFieldsFromPassthrough;
|
|
1763
|
+
private debug?;
|
|
1648
1764
|
private name;
|
|
1649
1765
|
private func;
|
|
1650
1766
|
constructor({ ai, name, description, definition, signature, agents, functions, }: Readonly<{
|
|
@@ -1683,6 +1799,7 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut = AxGenOut> imple
|
|
|
1683
1799
|
*/
|
|
1684
1800
|
setDescription(description: string): void;
|
|
1685
1801
|
setDefinition(definition: string): void;
|
|
1802
|
+
private getDebug;
|
|
1686
1803
|
}
|
|
1687
1804
|
|
|
1688
1805
|
interface AxApacheTikaArgs {
|
|
@@ -2278,4 +2395,4 @@ declare class AxRAG extends AxChainOfThought<{
|
|
|
2278
2395
|
}>;
|
|
2279
2396
|
}
|
|
2280
2397
|
|
|
2281
|
-
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, AxAIGoogleGeminiEmbedModel, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, 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, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, 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, AxBootstrapFewShot, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, 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, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldTemplateFn, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOptions, type AxGenOut, type AxGenStreamingOut, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, AxMemory, type AxMetricFn, type AxMetricFnArgs, AxMockAIService, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxOptimizerArgs, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxRoute, AxRouter, type AxRouterForwardOptions, AxSignature, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable };
|
|
2398
|
+
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, AxAIGoogleGeminiEmbedModel, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, 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, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, 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, AxBootstrapFewShot, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, 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, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldProcessor, type AxFieldTemplateFn, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOptions, type AxGenOut, type AxGenStreamingOut, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, AxMemory, type AxMetricFn, type AxMetricFnArgs, AxMockAIService, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxOptimizerArgs, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxRoute, AxRouter, type AxRouterForwardOptions, AxSignature, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable };
|
package/index.d.ts
CHANGED
|
@@ -36,7 +36,6 @@ declare class AxAIServiceError extends Error {
|
|
|
36
36
|
readonly context: Record<string, unknown>;
|
|
37
37
|
constructor(message: string, url: string, requestBody?: unknown | undefined, context?: Record<string, unknown>);
|
|
38
38
|
toString(): string;
|
|
39
|
-
toJSON(): Record<string, unknown>;
|
|
40
39
|
}
|
|
41
40
|
declare class AxAIServiceStatusError extends AxAIServiceError {
|
|
42
41
|
readonly status: number;
|
|
@@ -94,6 +93,8 @@ type AxModelConfig = {
|
|
|
94
93
|
type AxFunctionHandler = (args?: any, extra?: Readonly<{
|
|
95
94
|
sessionId?: string;
|
|
96
95
|
traceId?: string;
|
|
96
|
+
debug?: boolean;
|
|
97
|
+
ai?: AxAIService;
|
|
97
98
|
}>) => unknown;
|
|
98
99
|
type AxFunctionJSONSchema = {
|
|
99
100
|
type: string;
|
|
@@ -141,7 +142,7 @@ type AxModelInfoWithProvider = AxModelInfo & {
|
|
|
141
142
|
provider: string;
|
|
142
143
|
};
|
|
143
144
|
type AxChatRequest<TModel = string> = {
|
|
144
|
-
chatPrompt:
|
|
145
|
+
chatPrompt: ({
|
|
145
146
|
role: 'system';
|
|
146
147
|
content: string;
|
|
147
148
|
cache?: boolean;
|
|
@@ -183,7 +184,7 @@ type AxChatRequest<TModel = string> = {
|
|
|
183
184
|
isError?: boolean;
|
|
184
185
|
functionId: string;
|
|
185
186
|
cache?: boolean;
|
|
186
|
-
}
|
|
187
|
+
})[];
|
|
187
188
|
functions?: Readonly<{
|
|
188
189
|
name: string;
|
|
189
190
|
description: string;
|
|
@@ -195,7 +196,7 @@ type AxChatRequest<TModel = string> = {
|
|
|
195
196
|
name: string;
|
|
196
197
|
};
|
|
197
198
|
};
|
|
198
|
-
modelConfig?:
|
|
199
|
+
modelConfig?: AxModelConfig;
|
|
199
200
|
model?: TModel;
|
|
200
201
|
};
|
|
201
202
|
interface AxAIServiceMetrics {
|
|
@@ -250,6 +251,7 @@ type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown> = {
|
|
|
250
251
|
sessionId?: string;
|
|
251
252
|
traceId?: string;
|
|
252
253
|
rateLimiter?: AxRateLimiterFunction;
|
|
254
|
+
debug?: boolean;
|
|
253
255
|
};
|
|
254
256
|
interface AxAIService<TModel = unknown, TEmbedModel = unknown> {
|
|
255
257
|
getId(): string;
|
|
@@ -1064,6 +1066,7 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1064
1066
|
apiKey?: string;
|
|
1065
1067
|
projectId?: string;
|
|
1066
1068
|
region?: string;
|
|
1069
|
+
endpoint?: string;
|
|
1067
1070
|
config?: Readonly<Partial<AxAIGoogleGeminiConfig>>;
|
|
1068
1071
|
options?: Readonly<AxAIServiceOptions & AxAIGoogleGeminiOptionsTools>;
|
|
1069
1072
|
models?: AxAIModelList<AxAIGoogleGeminiModel>;
|
|
@@ -1072,7 +1075,7 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1072
1075
|
* AxAIGoogleGemini: AI Service
|
|
1073
1076
|
*/
|
|
1074
1077
|
declare class AxAIGoogleGemini extends AxBaseAI<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiChatRequest, AxAIGoogleGeminiBatchEmbedRequest | AxAIGoogleVertexBatchEmbedRequest, AxAIGoogleGeminiChatResponse, AxAIGoogleGeminiChatResponseDelta, AxAIGoogleGeminiBatchEmbedResponse | AxAIGoogleVertexBatchEmbedResponse> {
|
|
1075
|
-
constructor({ apiKey, projectId, region, config, options, models, }: Readonly<Omit<AxAIGoogleGeminiArgs, 'name'>>);
|
|
1078
|
+
constructor({ apiKey, projectId, region, endpoint, config, options, models, }: Readonly<Omit<AxAIGoogleGeminiArgs, 'name'>>);
|
|
1076
1079
|
}
|
|
1077
1080
|
|
|
1078
1081
|
declare enum AxAIGroqModel {
|
|
@@ -1284,12 +1287,17 @@ declare class AxAI implements AxAIService {
|
|
|
1284
1287
|
}
|
|
1285
1288
|
|
|
1286
1289
|
interface AxAIMemory {
|
|
1287
|
-
add(result: Readonly<AxChatRequest['chatPrompt'] | AxChatRequest['chatPrompt'][
|
|
1290
|
+
add(result: Readonly<AxChatRequest['chatPrompt']> | Readonly<AxChatRequest['chatPrompt'][number]>, sessionId?: string): void;
|
|
1288
1291
|
addResult(result: Readonly<AxChatResponseResult>, sessionId?: string): void;
|
|
1289
|
-
updateResult(result: Readonly<AxChatResponseResult
|
|
1292
|
+
updateResult(result: Readonly<AxChatResponseResult> & {
|
|
1293
|
+
delta?: string;
|
|
1294
|
+
}, sessionId?: string): void;
|
|
1290
1295
|
history(sessionId?: string): AxChatRequest['chatPrompt'];
|
|
1291
1296
|
reset(sessionId?: string): void;
|
|
1292
|
-
getLast(sessionId?: string):
|
|
1297
|
+
getLast(sessionId?: string): {
|
|
1298
|
+
chat: AxChatRequest['chatPrompt'][number];
|
|
1299
|
+
tags?: string[];
|
|
1300
|
+
} | undefined;
|
|
1293
1301
|
addTag(name: string, sessionId?: string): void;
|
|
1294
1302
|
rewindToTag(name: string, sessionId?: string): AxChatRequest['chatPrompt'];
|
|
1295
1303
|
}
|
|
@@ -1299,7 +1307,7 @@ interface AxField {
|
|
|
1299
1307
|
title?: string;
|
|
1300
1308
|
description?: string;
|
|
1301
1309
|
type?: {
|
|
1302
|
-
name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'date' | 'datetime' | 'class';
|
|
1310
|
+
name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'date' | 'datetime' | 'class' | 'code';
|
|
1303
1311
|
isArray: boolean;
|
|
1304
1312
|
classes?: string[];
|
|
1305
1313
|
};
|
|
@@ -1374,7 +1382,8 @@ type AxProgramForwardOptions = {
|
|
|
1374
1382
|
functions?: AxFunction[];
|
|
1375
1383
|
functionCall?: AxChatRequest['functionCall'];
|
|
1376
1384
|
stopFunction?: string;
|
|
1377
|
-
|
|
1385
|
+
fastFail?: boolean;
|
|
1386
|
+
debug?: boolean;
|
|
1378
1387
|
};
|
|
1379
1388
|
type AxProgramStreamingForwardOptions = Omit<AxProgramForwardOptions, 'stream'>;
|
|
1380
1389
|
type AxGenDeltaOut<OUT> = {
|
|
@@ -1461,19 +1470,122 @@ declare class AxAssertionError extends Error {
|
|
|
1461
1470
|
}[];
|
|
1462
1471
|
}
|
|
1463
1472
|
|
|
1473
|
+
interface AxFieldProcessor {
|
|
1474
|
+
field: Readonly<AxField>;
|
|
1475
|
+
/**
|
|
1476
|
+
* Process the field value and return a new value (or undefined if no update is needed).
|
|
1477
|
+
* The returned value may be merged back into memory.
|
|
1478
|
+
* @param value - The current field value.
|
|
1479
|
+
* @param context - Additional context (e.g. memory and session id).
|
|
1480
|
+
*/
|
|
1481
|
+
process: (value: AxFieldValue, context?: Readonly<{
|
|
1482
|
+
values?: AxGenOut;
|
|
1483
|
+
sessionId?: string;
|
|
1484
|
+
done?: boolean;
|
|
1485
|
+
}>) => any | Promise<any>;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1464
1488
|
declare class AxMemory implements AxAIMemory {
|
|
1465
1489
|
private limit;
|
|
1490
|
+
private debug;
|
|
1466
1491
|
private memories;
|
|
1467
1492
|
private defaultMemory;
|
|
1468
|
-
constructor(limit?: number);
|
|
1493
|
+
constructor(limit?: number, debug?: boolean);
|
|
1469
1494
|
private getMemory;
|
|
1470
|
-
add(value:
|
|
1495
|
+
add(value: AxChatRequest['chatPrompt'][number] | AxChatRequest['chatPrompt'], sessionId?: string): void;
|
|
1471
1496
|
addResult(result: Readonly<AxChatResponseResult>, sessionId?: string): void;
|
|
1472
1497
|
updateResult(result: Readonly<AxChatResponseResult>, sessionId?: string): void;
|
|
1473
1498
|
addTag(name: string, sessionId?: string): void;
|
|
1474
|
-
rewindToTag(name: string, sessionId?: string):
|
|
1475
|
-
|
|
1476
|
-
|
|
1499
|
+
rewindToTag(name: string, sessionId?: string): ({
|
|
1500
|
+
role: "system";
|
|
1501
|
+
content: string;
|
|
1502
|
+
cache?: boolean;
|
|
1503
|
+
} | {
|
|
1504
|
+
role: "user";
|
|
1505
|
+
name?: string;
|
|
1506
|
+
content: string | ({
|
|
1507
|
+
type: "text";
|
|
1508
|
+
text: string;
|
|
1509
|
+
cache?: boolean;
|
|
1510
|
+
} | {
|
|
1511
|
+
type: "image";
|
|
1512
|
+
mimeType: string;
|
|
1513
|
+
image: string;
|
|
1514
|
+
details?: "high" | "low" | "auto";
|
|
1515
|
+
cache?: boolean;
|
|
1516
|
+
} | {
|
|
1517
|
+
type: "audio";
|
|
1518
|
+
data: string;
|
|
1519
|
+
format?: "wav";
|
|
1520
|
+
cache?: boolean;
|
|
1521
|
+
})[];
|
|
1522
|
+
} | {
|
|
1523
|
+
role: "assistant";
|
|
1524
|
+
content?: string;
|
|
1525
|
+
name?: string;
|
|
1526
|
+
functionCalls?: {
|
|
1527
|
+
id: string;
|
|
1528
|
+
type: "function";
|
|
1529
|
+
function: {
|
|
1530
|
+
name: string;
|
|
1531
|
+
params?: string | object;
|
|
1532
|
+
};
|
|
1533
|
+
}[];
|
|
1534
|
+
cache?: boolean;
|
|
1535
|
+
} | {
|
|
1536
|
+
role: "function";
|
|
1537
|
+
result: string;
|
|
1538
|
+
isError?: boolean;
|
|
1539
|
+
functionId: string;
|
|
1540
|
+
cache?: boolean;
|
|
1541
|
+
})[];
|
|
1542
|
+
history(sessionId?: string): ({
|
|
1543
|
+
role: "system";
|
|
1544
|
+
content: string;
|
|
1545
|
+
cache?: boolean;
|
|
1546
|
+
} | {
|
|
1547
|
+
role: "user";
|
|
1548
|
+
name?: string;
|
|
1549
|
+
content: string | ({
|
|
1550
|
+
type: "text";
|
|
1551
|
+
text: string;
|
|
1552
|
+
cache?: boolean;
|
|
1553
|
+
} | {
|
|
1554
|
+
type: "image";
|
|
1555
|
+
mimeType: string;
|
|
1556
|
+
image: string;
|
|
1557
|
+
details?: "high" | "low" | "auto";
|
|
1558
|
+
cache?: boolean;
|
|
1559
|
+
} | {
|
|
1560
|
+
type: "audio";
|
|
1561
|
+
data: string;
|
|
1562
|
+
format?: "wav";
|
|
1563
|
+
cache?: boolean;
|
|
1564
|
+
})[];
|
|
1565
|
+
} | {
|
|
1566
|
+
role: "assistant";
|
|
1567
|
+
content?: string;
|
|
1568
|
+
name?: string;
|
|
1569
|
+
functionCalls?: {
|
|
1570
|
+
id: string;
|
|
1571
|
+
type: "function";
|
|
1572
|
+
function: {
|
|
1573
|
+
name: string;
|
|
1574
|
+
params?: string | object;
|
|
1575
|
+
};
|
|
1576
|
+
}[];
|
|
1577
|
+
cache?: boolean;
|
|
1578
|
+
} | {
|
|
1579
|
+
role: "function";
|
|
1580
|
+
result: string;
|
|
1581
|
+
isError?: boolean;
|
|
1582
|
+
functionId: string;
|
|
1583
|
+
cache?: boolean;
|
|
1584
|
+
})[];
|
|
1585
|
+
getLast(sessionId?: string): {
|
|
1586
|
+
chat: AxChatRequest["chatPrompt"][number];
|
|
1587
|
+
tags?: string[];
|
|
1588
|
+
} | undefined;
|
|
1477
1589
|
reset(sessionId?: string): void;
|
|
1478
1590
|
}
|
|
1479
1591
|
|
|
@@ -1542,8 +1654,6 @@ declare class AxPromptTemplate {
|
|
|
1542
1654
|
private renderInputFields;
|
|
1543
1655
|
private renderInField;
|
|
1544
1656
|
private defaultRenderInField;
|
|
1545
|
-
private renderDescFields;
|
|
1546
|
-
private renderFields;
|
|
1547
1657
|
}
|
|
1548
1658
|
|
|
1549
1659
|
interface AxGenOptions {
|
|
@@ -1561,6 +1671,7 @@ interface AxGenOptions {
|
|
|
1561
1671
|
promptTemplate?: typeof AxPromptTemplate;
|
|
1562
1672
|
asserts?: AxAssertion[];
|
|
1563
1673
|
streamingAsserts?: AxStreamingAssertion[];
|
|
1674
|
+
fastFail?: boolean;
|
|
1564
1675
|
}
|
|
1565
1676
|
type AxGenerateResult<OUT extends AxGenOut> = OUT & {
|
|
1566
1677
|
functions?: AxChatResponseFunctionCall[];
|
|
@@ -1577,7 +1688,7 @@ interface AxResponseHandlerArgs<T> {
|
|
|
1577
1688
|
sessionId?: string;
|
|
1578
1689
|
traceId?: string;
|
|
1579
1690
|
functions?: Readonly<AxFunction[]>;
|
|
1580
|
-
|
|
1691
|
+
fastFail?: boolean;
|
|
1581
1692
|
}
|
|
1582
1693
|
interface AxStreamingEvent<T> {
|
|
1583
1694
|
event: 'delta' | 'done' | 'error';
|
|
@@ -1595,9 +1706,12 @@ declare class AxGen<IN extends AxGenIn = AxGenIn, OUT extends AxGenerateResult<A
|
|
|
1595
1706
|
private options?;
|
|
1596
1707
|
private functions?;
|
|
1597
1708
|
private functionsExecuted;
|
|
1709
|
+
private fieldProcessors;
|
|
1710
|
+
private streamingFieldProcessors;
|
|
1598
1711
|
constructor(signature: Readonly<AxSignature | string>, options?: Readonly<AxGenOptions>);
|
|
1599
1712
|
addAssert: (fn: AxAssertion["fn"], message?: string) => void;
|
|
1600
1713
|
addStreamingAssert: (fieldName: string, fn: AxStreamingAssertion["fn"], message?: string) => void;
|
|
1714
|
+
addFieldProcessor: (fieldName: string, fn: AxFieldProcessor["process"], streaming?: boolean) => void;
|
|
1601
1715
|
private forwardSendRequest;
|
|
1602
1716
|
private forwardCore;
|
|
1603
1717
|
private processStreamingResponse;
|
|
@@ -1627,6 +1741,7 @@ type AxAgentOptions = Omit<AxGenOptions, 'functions'> & {
|
|
|
1627
1741
|
disableSmartModelRouting?: boolean;
|
|
1628
1742
|
/** List of field names that should not be automatically passed from parent to child agents */
|
|
1629
1743
|
excludeFieldsFromPassthrough?: string[];
|
|
1744
|
+
debug?: boolean;
|
|
1630
1745
|
};
|
|
1631
1746
|
interface AxAgentFeatures {
|
|
1632
1747
|
/** Whether this agent can use smart model routing (requires an AI service) */
|
|
@@ -1645,6 +1760,7 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut = AxGenOut> imple
|
|
|
1645
1760
|
private agents?;
|
|
1646
1761
|
private disableSmartModelRouting?;
|
|
1647
1762
|
private excludeFieldsFromPassthrough;
|
|
1763
|
+
private debug?;
|
|
1648
1764
|
private name;
|
|
1649
1765
|
private func;
|
|
1650
1766
|
constructor({ ai, name, description, definition, signature, agents, functions, }: Readonly<{
|
|
@@ -1683,6 +1799,7 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut = AxGenOut> imple
|
|
|
1683
1799
|
*/
|
|
1684
1800
|
setDescription(description: string): void;
|
|
1685
1801
|
setDefinition(definition: string): void;
|
|
1802
|
+
private getDebug;
|
|
1686
1803
|
}
|
|
1687
1804
|
|
|
1688
1805
|
interface AxApacheTikaArgs {
|
|
@@ -2278,4 +2395,4 @@ declare class AxRAG extends AxChainOfThought<{
|
|
|
2278
2395
|
}>;
|
|
2279
2396
|
}
|
|
2280
2397
|
|
|
2281
|
-
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, AxAIGoogleGeminiEmbedModel, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, 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, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, 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, AxBootstrapFewShot, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, 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, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldTemplateFn, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOptions, type AxGenOut, type AxGenStreamingOut, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, AxMemory, type AxMetricFn, type AxMetricFnArgs, AxMockAIService, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxOptimizerArgs, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxRoute, AxRouter, type AxRouterForwardOptions, AxSignature, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable };
|
|
2398
|
+
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, AxAIGoogleGeminiEmbedModel, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, 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, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, 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, AxBootstrapFewShot, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, 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, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldProcessor, type AxFieldTemplateFn, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOptions, type AxGenOut, type AxGenStreamingOut, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, AxMemory, type AxMetricFn, type AxMetricFnArgs, AxMockAIService, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxOptimizerArgs, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxRoute, AxRouter, type AxRouterForwardOptions, AxSignature, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable };
|