Skip to content

Commit 0579434

Browse files
committed
Handle potential case where assistant content is already a block
1 parent 9525ea8 commit 0579434

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

core/llm/llms/Cohere.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,14 @@ class Cohere extends BaseLLM {
7878
},
7979
}));
8080
} else {
81-
msg.content.push({
82-
type: "text",
83-
text: m.content,
84-
});
81+
if (typeof m.content === "string") {
82+
msg.content.push({
83+
type: "text",
84+
text: m.content,
85+
});
86+
} else {
87+
msg.content = m.content;
88+
}
8589
}
8690

8791
messages.push(msg);

0 commit comments

Comments
 (0)