-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue3 can't access toolResponse client side #3066
Comments
@cosbgn shortened urls like cln.sh are suspicious. please embed the screencast directly here |
Please check out this example https://github.com/vercel/ai/tree/main/examples/nuxt-openai and make sure that you use the latest versions of |
Hey @lgrammel thanks for the quick answer. I tested with the example and I get the same results. I attach the video directly here, but as a summary Not sure if related but openAI has a similar bug (openai/openai-node#1060). j04Cz8iyX3HuUZnZKnaUcuNqhPxOZ5vrt4TdGXGT.mp4 |
Not related to openai and def strange. What is your frontend code? |
@lgrammel it's identical to the linked example, I only alias the lib name. <script setup lang="ts">
import { useChat as useAiChat } from '@ai-sdk/vue';
const space = ref({id:123})
const { messages, input, handleSubmit, isLoading, completion, error, data } = useAiChat({
api:`/api/spaces/${space.value.id}/rag/chat_aisdk`,
maxSteps: 5,
})
</script> |
I have tried reproducing the issue with our standard vue example ( https://github.com/vercel/ai/tree/main/examples/nuxt-openai ) w/o success. The tool results do not disappear. Are you on the latest version of |
@lgrammel I still get the bug on both chome and firefox, could you test this: https://github.com/cosbgn/ai_sdk_bug I really don't understand what it could be. Here a video of the code running: 2024-09-20_14.58.59.mp4 |
Here you define messages instead of taking them from the request: https://github.com/cosbgn/ai_sdk_bug/blob/main/server/api/chat.js They should be extract from the request, see e.g. |
Hi @lgrammel that was hard-coded to simplify the repo and make sure functions get called, but that isn't the issue. I just pushed a new version where I parse the body and the error is definitely still happening. |
Thanks! Was able to reproduce with your example, looks like a bug. |
Identified the issue |
releasing |
Works! Thank you! |
Description
On my backend I have:
On my frontend:
Tool responses are initially added to the messages but when the callback finished (the message stop streaming) they get removed.
Code example
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: