@vellumai/plugin-api 0.9.0-dev.202606191038.0fd3d6e → 0.9.0-dev.202606191410.d7a0797

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 (2) hide show
  1. package/index.d.ts +12 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -3046,6 +3046,18 @@ export declare interface Provider {
3046
3046
  */
3047
3047
  tokenEstimationProvider?: string;
3048
3048
  sendMessage(messages: Message[], options?: SendMessageOptions): Promise<ProviderResponse>;
3049
+ /**
3050
+ * Exact prompt-token count from the provider's own tokenizer, for the
3051
+ * `messages` + `systemPrompt` + `tools` composition the next call would
3052
+ * send. Optional: providers without a token-counting endpoint omit it, and
3053
+ * callers must fall back to the local estimator (`estimatePromptTokens`).
3054
+ *
3055
+ * This runs a dedicated counting request (no inference), so it carries a
3056
+ * network round-trip and the provider's own rate limit — use it for
3057
+ * user-initiated, occasional actions (e.g. `/compact`), never on the
3058
+ * per-turn hot path.
3059
+ */
3060
+ countInputTokens?(messages: Message[], systemPrompt: string, tools?: ToolDefinition_2[]): Promise<number>;
3049
3061
  }
3050
3062
 
3051
3063
  export declare type ProviderEvent = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.9.0-dev.202606191038.0fd3d6e",
3
+ "version": "0.9.0-dev.202606191410.d7a0797",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",