@absolutejs/ai 0.1.3 → 0.2.1
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/CHANGELOG.md +13 -0
- package/README.md +18 -0
- package/changelog.json +34 -0
- package/dist/ai/index.js +47 -4
- package/dist/ai/index.js.map +6 -5
- package/dist/src/ai/index.d.ts +1 -0
- package/dist/src/ai/providerRouter.d.ts +4 -0
- package/dist/src/ai/streamAIWithTools.d.ts +2 -1
- package/package.json +1 -1
package/dist/src/ai/index.d.ts
CHANGED
|
@@ -47,3 +47,4 @@ export type { AITextPreparationCheckpoint } from "./prepareTextInput";
|
|
|
47
47
|
export { inspectAIContext, streamWithAIContext, isAIContextRejection, } from "./contextPolicy";
|
|
48
48
|
export type { AIContextBudget, AIContextCapacity, AIContextPolicy, AIContextEvent, AIContextRecoveryReason, } from "./contextPolicy";
|
|
49
49
|
export { createAIStoredToolResultRecovery } from "./storedToolResultRecovery";
|
|
50
|
+
export { createAIProviderRouter } from "./providerRouter";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AIProviderConfig } from "../../types/ai";
|
|
2
|
+
/** Route exact model IDs to providers. Counting, limits and generation use the
|
|
3
|
+
* same route, including when preparation uses a different model/provider. */
|
|
4
|
+
export declare const createAIProviderRouter: (routes: Readonly<Record<string, AIProviderConfig>>) => AIProviderConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AIProviderToolChoice, AIToolMap, AIUsage } from "../../types/ai";
|
|
1
|
+
import type { AIResponseMetadata, AIProviderToolChoice, AIToolMap, AIUsage } from "../../types/ai";
|
|
2
2
|
import { type GenerateAIOptions, type GenerateAIToolCall } from "./generateAI";
|
|
3
3
|
export type StreamAIWithToolsOptions = Omit<GenerateAIOptions, "tools" | "toolChoice"> & {
|
|
4
4
|
/** Tools the model may call — each with a `handler` the loop runs on its behalf. */
|
|
@@ -39,6 +39,7 @@ export type StreamAIWithToolsEvent = {
|
|
|
39
39
|
| {
|
|
40
40
|
type: "turn";
|
|
41
41
|
usage?: AIUsage;
|
|
42
|
+
metadata?: AIResponseMetadata;
|
|
42
43
|
} | {
|
|
43
44
|
type: "tool_start";
|
|
44
45
|
id: string;
|