@mastra/playground-ui 5.1.2 → 5.1.3
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.
- package/dist/index.cjs.js +20 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +20 -16
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4615,22 +4615,26 @@ function MastraRuntimeProvider({
|
|
|
4615
4615
|
if (messages.length === 0 || currentThreadId !== threadId || hasNewInitialMessages && currentThreadId === threadId) {
|
|
4616
4616
|
if (initialMessages && threadId && memory) {
|
|
4617
4617
|
const convertedMessages = initialMessages?.map((message) => {
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4618
|
+
const toolInvocationsAsContentParts = (message.toolInvocations || []).map((toolInvocation) => ({
|
|
4619
|
+
type: "tool-call",
|
|
4620
|
+
toolCallId: toolInvocation?.toolCallId,
|
|
4621
|
+
toolName: toolInvocation?.toolName,
|
|
4622
|
+
args: toolInvocation?.args,
|
|
4623
|
+
result: toolInvocation?.result
|
|
4624
|
+
}));
|
|
4625
|
+
const attachmentsAsContentParts = (message.experimental_attachments || []).map((image) => ({
|
|
4626
|
+
type: image.contentType.startsWith(`image/`) ? "image" : image.contentType.startsWith(`audio/`) ? "audio" : "file",
|
|
4627
|
+
mimeType: image.contentType,
|
|
4628
|
+
image: image.url
|
|
4629
|
+
}));
|
|
4630
|
+
return {
|
|
4631
|
+
...message,
|
|
4632
|
+
content: [
|
|
4633
|
+
...typeof message.content === "string" ? [{ type: "text", text: message.content }] : [],
|
|
4634
|
+
...toolInvocationsAsContentParts,
|
|
4635
|
+
...attachmentsAsContentParts
|
|
4636
|
+
]
|
|
4637
|
+
};
|
|
4634
4638
|
}).filter(Boolean);
|
|
4635
4639
|
setMessages(convertedMessages);
|
|
4636
4640
|
setCurrentThreadId(threadId);
|