@assistant-ui/react 0.0.21 → 0.0.23

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Simon Farshid
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # `@assistant-ui/react`
2
+
3
+ `@assistant-ui/react` is a set of React components for AI chat.
4
+
5
+ - [Website](https://assistant-ui.com/)
6
+ - [Demo](https://assistant-ui-rsc-example.vercel.app/)
7
+
8
+ ## Documentation
9
+
10
+ - [Documentation](https://www.assistant-ui.com/docs/getting-started)
11
+
12
+ ## Minimal Example with Vercel AI SDK
13
+
14
+ ```sh
15
+ npx @assistant-ui/shadcn add thread
16
+ ```
17
+
18
+ ```tsx
19
+ "use client";
20
+
21
+ import { useChat } from "@ai-sdk/react";
22
+ import { AssistantRuntimeProvider, useVercelAIRuntime } from "@assistant-ui/react";
23
+ import { Thread } from "@/components/ui/assistant-ui/thread";
24
+
25
+ const MyApp = () => {
26
+ const chat = useChat({
27
+ api: "/api/chat" // your backend route
28
+ });
29
+ const runtime = useVercelAIRuntime(chat);
30
+
31
+ return (
32
+ <AssistantRuntimeProvider runtime={runtime}>
33
+ <Thread />
34
+ </AssistantRuntimeProvider>
35
+ );
36
+ }
37
+ ```
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { FC, ReactNode, PropsWithChildren, ComponentType } from 'react';
3
3
  import { TextareaAutosizeProps } from 'react-textarea-autosize';
4
- import { UseChatHelpers, UseAssistantHelpers } from 'ai/react';
4
+ import { UseChatHelpers, UseAssistantHelpers } from '@ai-sdk/react';
5
5
  import { Message, LanguageModel } from 'ai';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import { UseBoundStore, StoreApi } from 'zustand';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { FC, ReactNode, PropsWithChildren, ComponentType } from 'react';
3
3
  import { TextareaAutosizeProps } from 'react-textarea-autosize';
4
- import { UseChatHelpers, UseAssistantHelpers } from 'ai/react';
4
+ import { UseChatHelpers, UseAssistantHelpers } from '@ai-sdk/react';
5
5
  import { Message, LanguageModel } from 'ai';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import { UseBoundStore, StoreApi } from 'zustand';
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
1
  {
2
2
  "name": "@assistant-ui/react",
3
- "version": "0.0.21",
3
+ "description": "React components for AI chat.",
4
+ "keywords": [
5
+ "radix-ui",
6
+ "nextjs",
7
+ "vercel",
8
+ "ai-sdk",
9
+ "react",
10
+ "components",
11
+ "ui",
12
+ "frontend",
13
+ "tailwind",
14
+ "shadcn",
15
+ "assistant",
16
+ "openai",
17
+ "ai",
18
+ "chat",
19
+ "chatbot",
20
+ "copilot",
21
+ "assistant",
22
+ "ai-chat",
23
+ "ai-chatbot",
24
+ "ai-assistant",
25
+ "ai-copilot",
26
+ "chatgpt",
27
+ "gpt4",
28
+ "gpt-4",
29
+ "conversational-ui",
30
+ "conversational-ai"
31
+ ],
32
+ "version": "0.0.23",
4
33
  "license": "MIT",
5
34
  "exports": {
6
35
  ".": {
@@ -18,11 +47,11 @@
18
47
  "main": "./dist/index.js",
19
48
  "module": "./dist/index.mjs",
20
49
  "types": "./dist/index.d.ts",
21
- "files": ["dist", "README.md"],
50
+ "files": [
51
+ "dist",
52
+ "README.md"
53
+ ],
22
54
  "sideEffects": false,
23
- "scripts": {
24
- "build": "tsup src/index.ts --format cjs,esm --dts"
25
- },
26
55
  "dependencies": {
27
56
  "@radix-ui/primitive": "^1.0.1",
28
57
  "@radix-ui/react-compose-refs": "^1.0.1",
@@ -34,11 +63,15 @@
34
63
  "zustand": "^4.5.2"
35
64
  },
36
65
  "peerDependencies": {
66
+ "@ai-sdk/react": "^0.0.x",
37
67
  "@types/react": "*",
38
- "ai": "^3",
68
+ "ai": "^3.1.31",
39
69
  "react": "^18"
40
70
  },
41
71
  "peerDependenciesMeta": {
72
+ "@ai-sdk/react": {
73
+ "optional": true
74
+ },
42
75
  "@types/react": {
43
76
  "optional": true
44
77
  },
@@ -50,9 +83,9 @@
50
83
  "access": "public"
51
84
  },
52
85
  "devDependencies": {
53
- "@assistant-ui/tsconfig": "workspace:*",
54
86
  "@types/node": "^20.14.2",
55
- "tsup": "^8.1.0"
87
+ "tsup": "^8.1.0",
88
+ "@assistant-ui/tsconfig": "0.0.0"
56
89
  },
57
90
  "homepage": "https://assistant-ui.com/",
58
91
  "repository": {
@@ -61,5 +94,9 @@
61
94
  },
62
95
  "bugs": {
63
96
  "url": "https://github.com/Yonom/assistant-ui/issues"
97
+ },
98
+ "scripts": {
99
+ "build": "tsup src/index.ts --format cjs,esm --dts",
100
+ "prepublish": "cp ../../README.md ./README.md"
64
101
  }
65
- }
102
+ }