@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.cjs.js
CHANGED
|
@@ -4647,22 +4647,26 @@ function MastraRuntimeProvider({
|
|
|
4647
4647
|
if (messages.length === 0 || currentThreadId !== threadId || hasNewInitialMessages && currentThreadId === threadId) {
|
|
4648
4648
|
if (initialMessages && threadId && memory) {
|
|
4649
4649
|
const convertedMessages = initialMessages?.map((message) => {
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4650
|
+
const toolInvocationsAsContentParts = (message.toolInvocations || []).map((toolInvocation) => ({
|
|
4651
|
+
type: "tool-call",
|
|
4652
|
+
toolCallId: toolInvocation?.toolCallId,
|
|
4653
|
+
toolName: toolInvocation?.toolName,
|
|
4654
|
+
args: toolInvocation?.args,
|
|
4655
|
+
result: toolInvocation?.result
|
|
4656
|
+
}));
|
|
4657
|
+
const attachmentsAsContentParts = (message.experimental_attachments || []).map((image) => ({
|
|
4658
|
+
type: image.contentType.startsWith(`image/`) ? "image" : image.contentType.startsWith(`audio/`) ? "audio" : "file",
|
|
4659
|
+
mimeType: image.contentType,
|
|
4660
|
+
image: image.url
|
|
4661
|
+
}));
|
|
4662
|
+
return {
|
|
4663
|
+
...message,
|
|
4664
|
+
content: [
|
|
4665
|
+
...typeof message.content === "string" ? [{ type: "text", text: message.content }] : [],
|
|
4666
|
+
...toolInvocationsAsContentParts,
|
|
4667
|
+
...attachmentsAsContentParts
|
|
4668
|
+
]
|
|
4669
|
+
};
|
|
4666
4670
|
}).filter(Boolean);
|
|
4667
4671
|
setMessages(convertedMessages);
|
|
4668
4672
|
setCurrentThreadId(threadId);
|