@ai-sdk/vue 4.0.152 → 4.0.154

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 (3) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +43 -3
  3. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @ai-sdk/vue
2
2
 
3
+ ## 4.0.154
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [47236dd]
8
+ - Updated dependencies [c8e8866]
9
+ - Updated dependencies [e64ed82]
10
+ - Updated dependencies [1cf95c6]
11
+ - ai@7.0.154
12
+ - @ai-sdk/provider-utils@5.0.69
13
+
14
+ ## 4.0.153
15
+
16
+ ### Patch Changes
17
+
18
+ - e729d58: chore(docs): update `README.md` for consistent format and to avoid duplication
19
+ - Updated dependencies [5475347]
20
+ - Updated dependencies [e729d58]
21
+ - ai@7.0.153
22
+ - @ai-sdk/provider-utils@5.0.68
23
+
3
24
  ## 4.0.152
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -2,6 +2,46 @@
2
2
 
3
3
  [Vue.js](https://vuejs.org/) UI components for the [AI SDK](https://ai-sdk.dev/docs):
4
4
 
5
- - [`useChat`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat) composable
6
- - [`useCompletion`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-completion) composable
7
- - [`useObject`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-object) composable
5
+ ## Setup
6
+
7
+ ```bash
8
+ npm i ai @ai-sdk/vue
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ <script setup lang="ts">
15
+ import { useChat } from "@ai-sdk/vue";
16
+ import { ref } from "vue";
17
+
18
+ const input = ref("");
19
+ const { messages, sendMessage } = useChat();
20
+
21
+ const handleSubmit = (e: Event) => {
22
+ e.preventDefault();
23
+ sendMessage({ text: input.value });
24
+ input.value = "";
25
+ };
26
+ </script>
27
+
28
+ <template>
29
+ <div>
30
+ <div v-for="(m, index) in messages" :key="m.id ? m.id : index">
31
+ {{ m.role === "user" ? "User: " : "AI: " }}
32
+ <div
33
+ v-for="(part, index) in m.parts"
34
+ :key="`${m.id}-${part.type}-${index}`"
35
+ >
36
+ <div v-if="part.type === 'text'">{{ part.text }}</div>
37
+ </div>
38
+ </div>
39
+
40
+ <form @submit="handleSubmit">
41
+ <input v-model="input" placeholder="Say something..." />
42
+ </form>
43
+ </div>
44
+ </template>
45
+ ```
46
+
47
+ See the [Vue.js documentation](https://ai-sdk.dev/docs/getting-started/nuxt) for more information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/vue",
3
- "version": "4.0.152",
3
+ "version": "4.0.154",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -26,8 +26,8 @@
26
26
  "README.md"
27
27
  ],
28
28
  "dependencies": {
29
- "@ai-sdk/provider-utils": "5.0.67",
30
- "ai": "7.0.152",
29
+ "@ai-sdk/provider-utils": "5.0.69",
30
+ "ai": "7.0.154",
31
31
  "swrv": "^1.2.0"
32
32
  },
33
33
  "devDependencies": {