From 0037b0c94414c10b78ec2a152b36adc1d35bda2f Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 7 Nov 2024 17:03:04 +0800 Subject: [PATCH] ts error --- app/components/realtime-chat/realtime-chat.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/components/realtime-chat/realtime-chat.tsx b/app/components/realtime-chat/realtime-chat.tsx index e58cfdf6bb2..ed606c7a2cd 100644 --- a/app/components/realtime-chat/realtime-chat.tsx +++ b/app/components/realtime-chat/realtime-chat.tsx @@ -90,11 +90,13 @@ export function RealtimeChat({ const recentMessages = chatStore.getMessagesWithMemory(); for (const message of recentMessages) { const { role, content } = message; - await clientRef.current.sendItem({ - type: "message", - role, - content: [{ type: "input_text", text: content }], - }); + if (typeof content === "string") { + await clientRef.current.sendItem({ + type: "message", + role: role as any, + content: [{ type: "input_text", text: content as string }], + }); + } } } catch (error) { console.error("Set message failed:", error);