@absolutejs/ai 0.2.5 → 0.2.6
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 +6 -0
- package/README.md +11 -0
- package/changelog.json +17 -0
- package/dist/ai/index.js +34 -14
- package/dist/ai/index.js.map +5 -5
- package/dist/ai/providers/anthropic.js +33 -14
- package/dist/ai/providers/anthropic.js.map +4 -4
- package/dist/ai/providers/gemini.js +2 -1
- package/dist/ai/providers/gemini.js.map +3 -3
- package/dist/ai/providers/openai.js +2 -1
- package/dist/ai/providers/openai.js.map +3 -3
- package/dist/ai/providers/openaiCompatible.js +2 -1
- package/dist/ai/providers/openaiCompatible.js.map +3 -3
- package/dist/ai/providers/openaiResponses.js +2 -1
- package/dist/ai/providers/openaiResponses.js.map +3 -3
- package/dist/ai/providers/openrouter.js +33 -14
- package/dist/ai/providers/openrouter.js.map +4 -4
- package/dist/src/ai/inputCapacity.d.ts +4 -0
- package/dist/types/ai.d.ts +2 -0
- package/package.json +1 -1
|
@@ -10,6 +10,10 @@ export type AIInputCapacity = {
|
|
|
10
10
|
inputTokens: number;
|
|
11
11
|
outputTokens: number;
|
|
12
12
|
availableInputTokens: number;
|
|
13
|
+
/** Caller-input counts exclude hosted tool definitions and future hosted results.
|
|
14
|
+
* Provider admission still validates the complete request. */
|
|
15
|
+
inputTokenScope: "request" | "caller-input";
|
|
16
|
+
/** Whether the counted scope fits; not a full hosted-workload guarantee. */
|
|
13
17
|
fits: boolean;
|
|
14
18
|
};
|
|
15
19
|
export declare class AIInputError extends Error {
|
package/dist/types/ai.d.ts
CHANGED
|
@@ -336,6 +336,8 @@ export type AIProviderConfig = {
|
|
|
336
336
|
isContextError?: (error: unknown) => boolean;
|
|
337
337
|
outputTokens?: (params: AIProviderStreamParams) => number | undefined;
|
|
338
338
|
getLimits: (params: AIProviderStreamParams) => Promise<import("../src/ai/inputCapacity").AIModelLimits>;
|
|
339
|
+
/** What countTokens measures. Hosted provider additions may be uncountable before execution. */
|
|
340
|
+
countScope?: (params: AIProviderStreamParams) => "request" | "caller-input";
|
|
339
341
|
countTokens: (params: AIProviderStreamParams) => Promise<number>;
|
|
340
342
|
};
|
|
341
343
|
stream: (params: AIProviderStreamParams) => AsyncIterable<AIChunk>;
|