@plucky-ai/react 0.3.0 → 0.3.1
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 +22 -7
- package/dist/package.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @plucky-ai/react
|
|
2
2
|
|
|
3
|
-
A React hook for using the Plucky Chat SDK.
|
|
3
|
+
A React hook for using the Plucky Chat SDK. Access the full docs [here](https://docs.plucky.ai).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -14,12 +14,27 @@ pnpm add @plucky-ai/react
|
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
|
-
```
|
|
18
|
-
import {
|
|
17
|
+
```tsx
|
|
18
|
+
import { useTools } from '@plucky-ai/react'
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
function MyComponent(props: { temperature: number }) {
|
|
21
|
+
useTools({
|
|
22
|
+
context: {
|
|
23
|
+
temperature,
|
|
24
|
+
},
|
|
25
|
+
tools: [
|
|
26
|
+
{
|
|
27
|
+
name: 'get_current_weather',
|
|
28
|
+
description: 'Get the current weather',
|
|
29
|
+
defaultLoadingText: 'Checking the weather...',
|
|
30
|
+
defaultSuccessText: 'Weather retrieved.',
|
|
31
|
+
cb: async (_, { temperature }) => {
|
|
32
|
+
return `It's currently ${temperature} degrees.`
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
})
|
|
23
37
|
|
|
24
|
-
|
|
38
|
+
return <div>My component content here</div>
|
|
39
|
+
}
|
|
25
40
|
```
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plucky-ai/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"react": "19.2.1",
|
|
17
17
|
"zod": "^4.1.11",
|
|
18
|
-
"@plucky-ai/chat-sdk": "^0.3.
|
|
18
|
+
"@plucky-ai/chat-sdk": "^0.3.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/react": "19.1.13",
|