This commit is contained in:
lloydzhou 2024-11-07 17:03:04 +08:00
parent 6f81bb3b8a
commit 0037b0c944

View File

@ -90,12 +90,14 @@ export function RealtimeChat({
const recentMessages = chatStore.getMessagesWithMemory(); const recentMessages = chatStore.getMessagesWithMemory();
for (const message of recentMessages) { for (const message of recentMessages) {
const { role, content } = message; const { role, content } = message;
if (typeof content === "string") {
await clientRef.current.sendItem({ await clientRef.current.sendItem({
type: "message", type: "message",
role, role: role as any,
content: [{ type: "input_text", text: content }], content: [{ type: "input_text", text: content as string }],
}); });
} }
}
} catch (error) { } catch (error) {
console.error("Set message failed:", error); console.error("Set message failed:", error);
} }