@rudra-js/anthropic 0.9.1 → 0.11.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/README.md +11 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
# @rudra-js/anthropic
|
|
2
2
|
|
|
3
|
-
This package is part of [rudra-js](https://rudrajs.com)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
It is not a hosted platform, a visual or low-code app builder, or a workspace you sign up for.
|
|
3
|
+
This package is part of [rudra-js](https://rudrajs.com), an open-source TypeScript library (MIT)
|
|
4
|
+
you install from npm. In rudra-js, a language model designs one product-recommendation block for a
|
|
5
|
+
page in your shop. Then rudra-js checks it against your catalog and React renders it. rudra-js isn't
|
|
6
|
+
a hosted platform, a visual or low-code app builder, or a workspace you sign up for.
|
|
8
7
|
|
|
9
8
|
This package plugs Anthropic's models into
|
|
10
|
-
[`@rudra-js/core`](https://github.com/clivedsouza1010/rudra-js/tree/main/packages/core)
|
|
11
|
-
|
|
9
|
+
[`@rudra-js/core`](https://github.com/clivedsouza1010/rudra-js/tree/main/packages/core) as a
|
|
10
|
+
`ComponentProvider`.
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
See the docs on [rudrajs.com](https://rudrajs.com/reference/anthropic/createAnthropicProvider).
|
|
14
13
|
|
|
15
14
|
> Anthropic and Claude are trademarks of Anthropic, PBC. This package is an
|
|
16
15
|
> independent adapter and is not affiliated with or endorsed by Anthropic.
|
|
@@ -46,15 +45,16 @@ By default, `model` is `claude-sonnet-5` and `thinking` is
|
|
|
46
45
|
optional too.
|
|
47
46
|
|
|
48
47
|
Your page request waits while generation runs inside core's `modelTimeoutMs`.
|
|
49
|
-
This is 1500ms by default.
|
|
48
|
+
This is 1500ms by default. To take the call out of the page request, see
|
|
49
|
+
[Keeping the model off the page](https://github.com/clivedsouza1010/rudra-js/tree/main/packages/core#keeping-the-model-off-the-page). If a model reasons before it answers, it won't finish
|
|
50
50
|
in that time. By default Sonnet 5 will reason if the request leaves `thinking`
|
|
51
51
|
out. So the `thinking` default is what keeps Sonnet 5 inside the time limit.
|
|
52
52
|
|
|
53
53
|
If you want to use another model, pass `model` and raise `modelTimeoutMs` to
|
|
54
54
|
match. Some models reject an explicit `{ type: 'disabled' }` and reason whatever
|
|
55
55
|
you send. For those models you will need to pass `thinking: null` to have the
|
|
56
|
-
adapter send no `thinking` field at all. There is
|
|
57
|
-
|
|
56
|
+
adapter send no `thinking` field at all. There is a demo in this repo that
|
|
57
|
+
pins `claude-opus-5` and gives `modelTimeoutMs` 60 seconds. That's a demo
|
|
58
58
|
setting. Don't use it in production.
|
|
59
59
|
|
|
60
60
|
This adapter asks the model to answer by calling its tool. But the call isn't
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rudra-js/anthropic",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Anthropic
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"description": "Use Anthropic's models with rudra-js. It calls the API with fetch, so there's no Anthropic SDK to install.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rudra-js",
|
|
7
7
|
"product-recommendations",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"zod": "^4.6.7"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@rudra-js/core": "^0.
|
|
55
|
+
"@rudra-js/core": "^0.11.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@rudra-js/core": "0.
|
|
58
|
+
"@rudra-js/core": "0.11.0",
|
|
59
59
|
"@types/node": "^26.4.1"
|
|
60
60
|
}
|
|
61
61
|
}
|