@rulvar/anthropic 1.126.0 → 1.127.0
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/dist/index.d.ts +3 -1
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,9 @@ interface AnthropicClientLike {
|
|
|
48
48
|
create(params: Record<string, unknown>, opts?: {
|
|
49
49
|
signal?: AbortSignal;
|
|
50
50
|
}): Promise<unknown>;
|
|
51
|
-
countTokens(params: Record<string, unknown
|
|
51
|
+
countTokens(params: Record<string, unknown>, opts?: {
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}): Promise<{
|
|
52
54
|
input_tokens: number;
|
|
53
55
|
}>;
|
|
54
56
|
};
|
package/dist/index.js
CHANGED
|
@@ -909,7 +909,7 @@ function anthropic(options = {}) {
|
|
|
909
909
|
};
|
|
910
910
|
}
|
|
911
911
|
},
|
|
912
|
-
async countTokens(req) {
|
|
912
|
+
async countTokens(req, opts) {
|
|
913
913
|
const info = infoFor(req.model);
|
|
914
914
|
const params = buildAnthropicParams(req, {
|
|
915
915
|
ids,
|
|
@@ -922,7 +922,7 @@ function anthropic(options = {}) {
|
|
|
922
922
|
};
|
|
923
923
|
if (params.system !== void 0) body.system = params.system;
|
|
924
924
|
if (params.tools !== void 0) body.tools = params.tools;
|
|
925
|
-
return (await client.messages.countTokens(body)).input_tokens;
|
|
925
|
+
return (await client.messages.countTokens(body, opts?.signal === void 0 ? void 0 : { signal: opts.signal })).input_tokens;
|
|
926
926
|
}
|
|
927
927
|
};
|
|
928
928
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/anthropic",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.127.0",
|
|
4
4
|
"description": "Rulvar first-class provider adapter over @anthropic-ai/sdk.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@anthropic-ai/sdk": "^0.115.0",
|
|
26
|
-
"@rulvar/core": "1.
|
|
26
|
+
"@rulvar/core": "1.127.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^22.20.1",
|
|
30
30
|
"tsdown": "^0.22.14",
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
|
-
"@rulvar/testing": "1.
|
|
32
|
+
"@rulvar/testing": "1.127.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|