@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.
@@ -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 {
@@ -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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/ai",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "homepage": "https://github.com/absolutejs/ai",
5
5
  "bugs": {
6
6
  "url": "https://github.com/absolutejs/ai/issues"