@ai-sdk/vue
Advanced tools
Comparing version 0.0.6 to 0.0.7
# @ai-sdk/vue | ||
## 0.0.7 | ||
### Patch Changes | ||
- Updated dependencies [54bf4083] | ||
- @ai-sdk/ui-utils@0.0.6 | ||
## 0.0.6 | ||
@@ -4,0 +11,0 @@ |
@@ -98,23 +98,25 @@ "use strict"; | ||
const existingData = (_a2 = streamData.value) != null ? _a2 : []; | ||
const constructedMessagesPayload = sendExtraMessageFields ? chatRequest.messages : chatRequest.messages.map( | ||
({ | ||
role, | ||
content, | ||
name, | ||
data: data2, | ||
annotations, | ||
function_call | ||
}) => ({ | ||
role, | ||
content, | ||
...name !== void 0 && { name }, | ||
...data2 !== void 0 && { data: data2 }, | ||
...annotations !== void 0 && { annotations }, | ||
// outdated function/tool call handling (TODO deprecate): | ||
...function_call !== void 0 && { function_call } | ||
}) | ||
); | ||
return await (0, import_ui_utils.callChatApi)({ | ||
api, | ||
messages: sendExtraMessageFields ? chatRequest.messages : chatRequest.messages.map( | ||
({ | ||
role, | ||
content, | ||
name, | ||
data: data2, | ||
annotations, | ||
function_call | ||
}) => ({ | ||
role, | ||
content, | ||
...name !== void 0 && { name }, | ||
...data2 !== void 0 && { data: data2 }, | ||
...annotations !== void 0 && { annotations }, | ||
// outdated function/tool call handling (TODO deprecate): | ||
...function_call !== void 0 && { function_call } | ||
}) | ||
), | ||
messages: constructedMessagesPayload, | ||
body: { | ||
messages: constructedMessagesPayload, | ||
data: chatRequest.data, | ||
@@ -121,0 +123,0 @@ ...(0, import_vue.unref)(body), |
{ | ||
"name": "@ai-sdk/vue", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"license": "Apache-2.0", | ||
@@ -18,3 +18,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@ai-sdk/ui-utils": "0.0.5", | ||
"@ai-sdk/ui-utils": "0.0.6", | ||
"swrv": "1.0.4" | ||
@@ -21,0 +21,0 @@ }, |
@@ -141,25 +141,28 @@ import type { | ||
const constructedMessagesPayload = sendExtraMessageFields | ||
? chatRequest.messages | ||
: chatRequest.messages.map( | ||
({ | ||
role, | ||
content, | ||
name, | ||
data, | ||
annotations, | ||
function_call, | ||
}) => ({ | ||
role, | ||
content, | ||
...(name !== undefined && { name }), | ||
...(data !== undefined && { data }), | ||
...(annotations !== undefined && { annotations }), | ||
// outdated function/tool call handling (TODO deprecate): | ||
...(function_call !== undefined && { function_call }), | ||
}), | ||
); | ||
return await callChatApi({ | ||
api, | ||
messages: sendExtraMessageFields | ||
? chatRequest.messages | ||
: chatRequest.messages.map( | ||
({ | ||
role, | ||
content, | ||
name, | ||
data, | ||
annotations, | ||
function_call, | ||
}) => ({ | ||
role, | ||
content, | ||
...(name !== undefined && { name }), | ||
...(data !== undefined && { data }), | ||
...(annotations !== undefined && { annotations }), | ||
// outdated function/tool call handling (TODO deprecate): | ||
...(function_call !== undefined && { function_call }), | ||
}), | ||
), | ||
messages: constructedMessagesPayload, | ||
body: { | ||
messages: constructedMessagesPayload, | ||
data: chatRequest.data, | ||
@@ -166,0 +169,0 @@ ...unref(body), // Use unref to unwrap the ref value |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
89325
1331
+ Added@ai-sdk/ui-utils@0.0.6(transitive)
- Removed@ai-sdk/ui-utils@0.0.5(transitive)
Updated@ai-sdk/ui-utils@0.0.6