ai-functions 2.0.2 → 2.1.3

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.
Files changed (130) hide show
  1. package/.turbo/turbo-build.log +4 -5
  2. package/CHANGELOG.md +38 -0
  3. package/LICENSE +21 -0
  4. package/README.md +361 -159
  5. package/dist/ai-promise.d.ts +47 -0
  6. package/dist/ai-promise.d.ts.map +1 -1
  7. package/dist/ai-promise.js +291 -3
  8. package/dist/ai-promise.js.map +1 -1
  9. package/dist/ai.d.ts +17 -18
  10. package/dist/ai.d.ts.map +1 -1
  11. package/dist/ai.js +93 -39
  12. package/dist/ai.js.map +1 -1
  13. package/dist/batch-map.d.ts +46 -4
  14. package/dist/batch-map.d.ts.map +1 -1
  15. package/dist/batch-map.js +35 -2
  16. package/dist/batch-map.js.map +1 -1
  17. package/dist/batch-queue.d.ts +116 -12
  18. package/dist/batch-queue.d.ts.map +1 -1
  19. package/dist/batch-queue.js +47 -2
  20. package/dist/batch-queue.js.map +1 -1
  21. package/dist/budget.d.ts +272 -0
  22. package/dist/budget.d.ts.map +1 -0
  23. package/dist/budget.js +500 -0
  24. package/dist/budget.js.map +1 -0
  25. package/dist/cache.d.ts +272 -0
  26. package/dist/cache.d.ts.map +1 -0
  27. package/dist/cache.js +412 -0
  28. package/dist/cache.js.map +1 -0
  29. package/dist/context.d.ts +32 -1
  30. package/dist/context.d.ts.map +1 -1
  31. package/dist/context.js +16 -1
  32. package/dist/context.js.map +1 -1
  33. package/dist/eval/runner.d.ts +2 -1
  34. package/dist/eval/runner.d.ts.map +1 -1
  35. package/dist/eval/runner.js.map +1 -1
  36. package/dist/generate.d.ts.map +1 -1
  37. package/dist/generate.js +6 -10
  38. package/dist/generate.js.map +1 -1
  39. package/dist/index.d.ts +27 -20
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +72 -42
  42. package/dist/index.js.map +1 -1
  43. package/dist/primitives.d.ts +17 -0
  44. package/dist/primitives.d.ts.map +1 -1
  45. package/dist/primitives.js +19 -1
  46. package/dist/primitives.js.map +1 -1
  47. package/dist/retry.d.ts +303 -0
  48. package/dist/retry.d.ts.map +1 -0
  49. package/dist/retry.js +539 -0
  50. package/dist/retry.js.map +1 -0
  51. package/dist/schema.d.ts.map +1 -1
  52. package/dist/schema.js +1 -9
  53. package/dist/schema.js.map +1 -1
  54. package/dist/tool-orchestration.d.ts +391 -0
  55. package/dist/tool-orchestration.d.ts.map +1 -0
  56. package/dist/tool-orchestration.js +663 -0
  57. package/dist/tool-orchestration.js.map +1 -0
  58. package/dist/types.d.ts +50 -33
  59. package/dist/types.d.ts.map +1 -1
  60. package/evalite.config.js +14 -0
  61. package/evals/classification.eval.js +97 -0
  62. package/evals/marketing.eval.js +289 -0
  63. package/evals/math.eval.js +83 -0
  64. package/evals/run-evals.js +151 -0
  65. package/evals/structured-output.eval.js +131 -0
  66. package/evals/writing.eval.js +105 -0
  67. package/examples/batch-blog-posts.js +128 -0
  68. package/package.json +26 -26
  69. package/src/ai-promise.ts +359 -3
  70. package/src/ai.ts +155 -110
  71. package/src/batch/anthropic.js +256 -0
  72. package/src/batch/bedrock.js +584 -0
  73. package/src/batch/cloudflare.js +287 -0
  74. package/src/batch/google.js +359 -0
  75. package/src/batch/index.js +30 -0
  76. package/src/batch/memory.js +187 -0
  77. package/src/batch/openai.js +402 -0
  78. package/src/batch-map.ts +46 -4
  79. package/src/batch-queue.ts +116 -12
  80. package/src/budget.ts +727 -0
  81. package/src/cache.ts +653 -0
  82. package/src/context.ts +33 -1
  83. package/src/eval/index.js +7 -0
  84. package/src/eval/models.js +119 -0
  85. package/src/eval/runner.js +147 -0
  86. package/src/eval/runner.ts +3 -2
  87. package/src/generate.ts +7 -12
  88. package/src/index.ts +231 -53
  89. package/src/primitives.ts +19 -1
  90. package/src/retry.ts +776 -0
  91. package/src/schema.ts +1 -10
  92. package/src/tool-orchestration.ts +1008 -0
  93. package/src/types.ts +59 -41
  94. package/test/ai-proxy.test.js +157 -0
  95. package/test/async-iterators.test.js +261 -0
  96. package/test/backward-compat.test.ts +147 -0
  97. package/test/batch-autosubmit-errors.test.ts +598 -0
  98. package/test/batch-background.test.js +352 -0
  99. package/test/batch-blog-posts.test.js +293 -0
  100. package/test/blog-generation.test.js +390 -0
  101. package/test/browse-read.test.js +480 -0
  102. package/test/budget-tracking.test.ts +800 -0
  103. package/test/cache.test.ts +712 -0
  104. package/test/context-isolation.test.ts +687 -0
  105. package/test/core-functions.test.js +490 -0
  106. package/test/decide.test.js +260 -0
  107. package/test/define.test.js +232 -0
  108. package/test/e2e-bedrock-manual.js +136 -0
  109. package/test/e2e-bedrock.test.js +164 -0
  110. package/test/e2e-flex-gateway.js +131 -0
  111. package/test/e2e-flex-manual.js +156 -0
  112. package/test/e2e-flex.test.js +174 -0
  113. package/test/e2e-google-manual.js +150 -0
  114. package/test/e2e-google.test.js +181 -0
  115. package/test/embeddings.test.js +220 -0
  116. package/test/evals/define-function.eval.test.js +309 -0
  117. package/test/evals/deterministic.eval.test.ts +376 -0
  118. package/test/evals/primitives.eval.test.js +360 -0
  119. package/test/function-types.test.js +407 -0
  120. package/test/generate-core.test.js +213 -0
  121. package/test/generate.test.js +143 -0
  122. package/test/generic-order.test.ts +342 -0
  123. package/test/implicit-batch.test.js +326 -0
  124. package/test/json-parse-error-handling.test.ts +463 -0
  125. package/test/retry.test.ts +1016 -0
  126. package/test/schema.test.js +96 -0
  127. package/test/streaming.test.ts +316 -0
  128. package/test/tagged-templates.test.js +240 -0
  129. package/test/tool-orchestration.test.ts +770 -0
  130. package/vitest.config.js +39 -0
@@ -0,0 +1,391 @@
1
+ /**
2
+ * Agentic Tool Orchestration
3
+ *
4
+ * Provides multi-turn model→tools→model loop orchestration for complex AI workflows.
5
+ *
6
+ * Key components:
7
+ * - AgenticLoop: Orchestrates multi-turn conversations with tool execution
8
+ * - ToolRouter: Routes tool calls to registered handlers
9
+ * - ToolValidator: Validates tool arguments before execution
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ import { z, type ZodTypeAny } from 'zod';
14
+ /**
15
+ * A tool that can be executed by the agentic loop
16
+ */
17
+ export interface Tool<TParams extends ZodTypeAny = ZodTypeAny, TResult = unknown> {
18
+ /** Unique name for the tool */
19
+ name: string;
20
+ /** Human-readable description */
21
+ description: string;
22
+ /** Zod schema for parameters */
23
+ parameters: TParams;
24
+ /** Execute the tool with validated parameters */
25
+ execute: (params: z.infer<TParams>) => Promise<TResult>;
26
+ }
27
+ /**
28
+ * A tool call from the model
29
+ */
30
+ export interface ToolCall {
31
+ /** Name of the tool to call */
32
+ name: string;
33
+ /** Arguments for the tool */
34
+ arguments: Record<string, unknown>;
35
+ /** Optional ID for tracking */
36
+ id?: string;
37
+ }
38
+ /**
39
+ * Result of a tool execution
40
+ */
41
+ export interface ToolResult<T = unknown> {
42
+ /** Whether execution succeeded */
43
+ success: boolean;
44
+ /** The result value if successful */
45
+ result?: T;
46
+ /** Error message if failed */
47
+ error?: string;
48
+ /** The original tool call */
49
+ toolCall?: ToolCall;
50
+ /** Number of retries attempted */
51
+ retryCount?: number;
52
+ }
53
+ /**
54
+ * Formatted tool result for model consumption
55
+ */
56
+ export interface FormattedToolResult {
57
+ /** Role is always 'tool' */
58
+ role: 'tool';
59
+ /** String content of the result */
60
+ content: string;
61
+ /** Tool call ID for correlation */
62
+ tool_call_id?: string;
63
+ /** Whether this is an error result */
64
+ isError?: boolean;
65
+ }
66
+ /**
67
+ * Validation result for tool arguments
68
+ */
69
+ export interface ValidationResult {
70
+ /** Whether validation passed */
71
+ valid: boolean;
72
+ /** Validation errors if any */
73
+ errors?: string[];
74
+ /** Validated and parsed arguments */
75
+ parsedArgs?: unknown;
76
+ }
77
+ /**
78
+ * Model response from a generation
79
+ */
80
+ export interface ModelResponse {
81
+ /** Generated text (if no tool calls) */
82
+ text?: string;
83
+ /** Tool calls requested by the model */
84
+ toolCalls?: ToolCall[];
85
+ /** Why generation stopped */
86
+ finishReason: 'stop' | 'tool_call' | 'length' | 'content_filter' | 'error';
87
+ /** Token usage */
88
+ usage?: {
89
+ promptTokens: number;
90
+ completionTokens: number;
91
+ totalTokens: number;
92
+ };
93
+ }
94
+ /**
95
+ * Message in the conversation
96
+ */
97
+ export interface Message {
98
+ role: 'user' | 'assistant' | 'system' | 'tool';
99
+ content: string;
100
+ tool_calls?: ToolCall[];
101
+ tool_call_id?: string;
102
+ isError?: boolean;
103
+ }
104
+ /**
105
+ * Step information for callbacks
106
+ */
107
+ export interface StepInfo {
108
+ /** Step number (1-indexed) */
109
+ stepNumber: number;
110
+ /** Tool calls in this step */
111
+ toolCalls: Array<ToolCall & {
112
+ result?: unknown;
113
+ error?: string;
114
+ }>;
115
+ /** Model response */
116
+ response: ModelResponse;
117
+ /** Current messages */
118
+ messages: Message[];
119
+ }
120
+ /**
121
+ * Options for creating an AgenticLoop
122
+ */
123
+ export interface LoopOptions {
124
+ /** Available tools */
125
+ tools: Tool[];
126
+ /** Maximum number of steps before stopping */
127
+ maxSteps: number;
128
+ /** Whether to throw error when maxSteps is exceeded */
129
+ strictMaxSteps?: boolean;
130
+ /** Whether to execute tool calls in parallel */
131
+ parallelExecution?: boolean;
132
+ /** Maximum concurrent tool calls when parallel execution is enabled */
133
+ maxParallelCalls?: number;
134
+ /** Whether to retry failed tool calls */
135
+ retryFailedTools?: boolean;
136
+ /** Maximum retries per tool call */
137
+ maxToolRetries?: number;
138
+ /** Whether to continue when a tool fails */
139
+ continueOnError?: boolean;
140
+ /** Timeout for individual tool execution (ms) */
141
+ toolTimeout?: number;
142
+ /** Track token usage across steps */
143
+ trackUsage?: boolean;
144
+ /** Callback for each step */
145
+ onStep?: (step: StepInfo) => void;
146
+ }
147
+ /**
148
+ * Options for running the loop
149
+ */
150
+ export interface RunOptions {
151
+ /** Model to use for generation */
152
+ model: {
153
+ generate: (options: any) => Promise<ModelResponse>;
154
+ };
155
+ /** Initial prompt */
156
+ prompt: string;
157
+ /** System message */
158
+ system?: string;
159
+ /** Abort signal */
160
+ abortSignal?: AbortSignal;
161
+ }
162
+ /**
163
+ * Extended tool call result with metadata
164
+ */
165
+ export interface ToolCallResult {
166
+ /** Tool name */
167
+ name: string;
168
+ /** Arguments passed */
169
+ arguments: Record<string, unknown>;
170
+ /** Result if successful */
171
+ result?: unknown;
172
+ /** Error if failed */
173
+ error?: string;
174
+ /** Number of retries */
175
+ retryCount?: number;
176
+ }
177
+ /**
178
+ * Tool result for SDK compatibility
179
+ */
180
+ export interface SDKToolResult {
181
+ /** Tool name */
182
+ toolName: string;
183
+ /** Tool call ID */
184
+ toolCallId?: string;
185
+ /** Result value */
186
+ result: unknown;
187
+ }
188
+ /**
189
+ * Result of running the agentic loop
190
+ */
191
+ export interface LoopResult {
192
+ /** Final text output */
193
+ text: string;
194
+ /** Number of steps executed */
195
+ steps: number;
196
+ /** All tool calls made */
197
+ toolCalls: ToolCallResult[];
198
+ /** Tool results in SDK format */
199
+ toolResults: SDKToolResult[];
200
+ /** Why the loop stopped */
201
+ stopReason: 'stop' | 'max_steps' | 'error' | 'aborted';
202
+ /** Token usage if tracked */
203
+ usage?: {
204
+ promptTokens: number;
205
+ completionTokens: number;
206
+ totalTokens: number;
207
+ };
208
+ /** Conversation messages */
209
+ messages: Message[];
210
+ }
211
+ /**
212
+ * Validates tool arguments before execution
213
+ */
214
+ export declare class ToolValidator {
215
+ private tools;
216
+ /**
217
+ * Register a tool for validation
218
+ */
219
+ register(tool: Tool): void;
220
+ /**
221
+ * Validate arguments for a tool
222
+ */
223
+ validate(toolName: string, args: unknown): ValidationResult;
224
+ /**
225
+ * Validate multiple tool calls at once
226
+ */
227
+ validateAll(calls: ToolCall[]): ValidationResult[];
228
+ }
229
+ /**
230
+ * Routes tool calls to registered handlers
231
+ */
232
+ export declare class ToolRouter {
233
+ private tools;
234
+ private validator;
235
+ /**
236
+ * Register a tool
237
+ */
238
+ register(tool: Tool): void;
239
+ /**
240
+ * Route a single tool call
241
+ */
242
+ route(call: ToolCall): Promise<ToolResult>;
243
+ /**
244
+ * Route multiple tool calls sequentially
245
+ */
246
+ routeAll(calls: ToolCall[]): Promise<ToolResult[]>;
247
+ /**
248
+ * Route multiple tool calls in parallel
249
+ */
250
+ routeAllParallel(calls: ToolCall[]): Promise<ToolResult[]>;
251
+ /**
252
+ * Format a tool result for model consumption
253
+ */
254
+ formatResult(result: ToolResult): FormattedToolResult;
255
+ }
256
+ /**
257
+ * Orchestrates multi-turn model→tools→model loops
258
+ */
259
+ export declare class AgenticLoop {
260
+ private options;
261
+ private router;
262
+ private validator;
263
+ constructor(options: LoopOptions);
264
+ /**
265
+ * Get tools in AI SDK format
266
+ */
267
+ getToolsForSDK(): Record<string, {
268
+ description: string;
269
+ parameters: unknown;
270
+ execute: (args: unknown) => Promise<unknown>;
271
+ }>;
272
+ /**
273
+ * Execute a tool call with timeout and retry support
274
+ */
275
+ private executeToolCall;
276
+ /**
277
+ * Execute multiple tool calls
278
+ */
279
+ private executeToolCalls;
280
+ /**
281
+ * Build messages for the next model call
282
+ */
283
+ private buildMessages;
284
+ /**
285
+ * Run the agentic loop
286
+ */
287
+ run(runOptions: RunOptions): Promise<LoopResult>;
288
+ /**
289
+ * Run the agentic loop with streaming support
290
+ *
291
+ * Returns an async generator that yields step events as they occur.
292
+ */
293
+ stream(runOptions: RunOptions): AsyncGenerator<LoopStreamEvent, LoopResult>;
294
+ }
295
+ /**
296
+ * Events emitted during streaming loop execution
297
+ */
298
+ export type LoopStreamEvent = {
299
+ type: 'start';
300
+ prompt: string;
301
+ timestamp: number;
302
+ } | {
303
+ type: 'step_start';
304
+ stepNumber: number;
305
+ timestamp: number;
306
+ } | {
307
+ type: 'step_end';
308
+ stepNumber: number;
309
+ hasToolCalls: boolean;
310
+ timestamp: number;
311
+ } | {
312
+ type: 'text';
313
+ text: string;
314
+ stepNumber: number;
315
+ timestamp: number;
316
+ } | {
317
+ type: 'tool_calls';
318
+ toolCalls: ToolCall[];
319
+ stepNumber: number;
320
+ timestamp: number;
321
+ } | {
322
+ type: 'tool_result';
323
+ toolName: string;
324
+ result?: unknown;
325
+ error?: string;
326
+ stepNumber: number;
327
+ timestamp: number;
328
+ } | {
329
+ type: 'max_steps';
330
+ steps: number;
331
+ timestamp: number;
332
+ } | {
333
+ type: 'aborted';
334
+ steps: number;
335
+ timestamp: number;
336
+ } | {
337
+ type: 'error';
338
+ error: string;
339
+ timestamp: number;
340
+ } | {
341
+ type: 'end';
342
+ steps: number;
343
+ stopReason: LoopResult['stopReason'];
344
+ timestamp: number;
345
+ };
346
+ /**
347
+ * Create a tool from a simple function
348
+ */
349
+ export declare function createTool<TParams extends z.ZodRawShape, TResult>(config: {
350
+ name: string;
351
+ description: string;
352
+ parameters: TParams;
353
+ execute: (params: z.infer<z.ZodObject<TParams>>) => Promise<TResult>;
354
+ }): Tool<z.ZodObject<TParams>, TResult>;
355
+ /**
356
+ * Compose multiple tools into a single toolset
357
+ */
358
+ export declare function createToolset(...tools: Tool[]): Tool[];
359
+ /**
360
+ * Create a tool that wraps another tool with middleware
361
+ */
362
+ export declare function wrapTool<T extends Tool>(tool: T, middleware: {
363
+ before?: (params: unknown) => Promise<unknown> | unknown;
364
+ after?: (result: unknown) => Promise<unknown> | unknown;
365
+ onError?: (error: Error) => Promise<unknown> | unknown;
366
+ }): Tool;
367
+ /**
368
+ * Create a tool with caching support
369
+ */
370
+ export declare function cachedTool<T extends Tool>(tool: T, options?: {
371
+ ttl?: number;
372
+ keyFn?: (params: unknown) => string;
373
+ }): Tool;
374
+ /**
375
+ * Create a tool with rate limiting
376
+ */
377
+ export declare function rateLimitedTool<T extends Tool>(tool: T, options: {
378
+ maxCalls: number;
379
+ windowMs: number;
380
+ }): Tool;
381
+ /**
382
+ * Create a tool that times out after a specified duration
383
+ */
384
+ export declare function timeoutTool<T extends Tool>(tool: T, timeoutMs: number): Tool;
385
+ /**
386
+ * Create an agentic loop with sensible defaults
387
+ */
388
+ export declare function createAgenticLoop(options: Partial<LoopOptions> & {
389
+ tools: Tool[];
390
+ }): AgenticLoop;
391
+ //# sourceMappingURL=tool-orchestration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-orchestration.d.ts","sourceRoot":"","sources":["../src/tool-orchestration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAA;AAMxC;;GAEG;AACH,MAAM,WAAW,IAAI,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,EAAE,OAAO,GAAG,OAAO;IAC9E,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,gCAAgC;IAChC,UAAU,EAAE,OAAO,CAAA;IACnB,iDAAiD;IACjD,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,+BAA+B;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO;IACrC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,qCAAqC;IACrC,MAAM,CAAC,EAAE,CAAC,CAAA;IACV,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,OAAO,EAAE,MAA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