fix(stage-ui): proxy object could not be cloned (#193)
* Fix for proxy could not be cloned error After several debugging, it was found that streamText initialisation called the structuredClone() function on messages. The problem is that messages is an object containing vue3 proxies, that can not be cloned. My proposed fix is to remove those proxies before passing messages to streamText * Revert "Fix for proxy could not be cloned error" This reverts commit 1575d305d5e5df3294991dbf7c8c25abfbfc783e. * Fix for proxy clone error rest.tool_results is also a proxy that was not removed properly
This commit is contained in:
@@ -136,6 +136,7 @@ export const useChatStore = defineStore('chat', () => {
|
||||
const newMessages = messages.value.slice(0, messages.value.length - 1).map((msg) => {
|
||||
if (msg.role === 'assistant') {
|
||||
const { slices: _, ...rest } = msg // exclude slices
|
||||
rest.tool_results = toRaw(rest.tool_results)
|
||||
return toRaw(rest)
|
||||
}
|
||||
return toRaw(msg)
|
||||
|
||||
Reference in New Issue
Block a user