Skip to content

Commit

Permalink
unwrap body parameter to make it reactive (#511)
Browse files Browse the repository at this point in the history
Co-authored-by: Max Leiter <max.leiter@vercel.com>
  • Loading branch information
dosstx and MaxLeiter committed Aug 24, 2023
1 parent ad10953 commit 3fc2b32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-eggs-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'ai': patch
---

ai/vue: fix: make body parameter reactive
4 changes: 2 additions & 2 deletions packages/core/vue/use-chat.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import swrv from 'swrv'
import { ref } from 'vue'
import { ref, unref } from 'vue'
import type { Ref } from 'vue'

import type {
Expand Down Expand Up @@ -120,7 +120,7 @@ export function useChat({
role,
content
})),
...body,
...unref(body), // Use unref to unwrap the ref value
...options?.body
}),
headers: {
Expand Down

0 comments on commit 3fc2b32

Please sign in to comment.