Skip to content

Commit

Permalink
ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Nov 7, 2024
1 parent 6f81bb3 commit 0037b0c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/components/realtime-chat/realtime-chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0037b0c

Please sign in to comment.