lloydzhou 1 년 전
부모
커밋
0037b0c944
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 7 5
      app/components/realtime-chat/realtime-chat.tsx

+ 7 - 5
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);