🐛 don't send image_url if not image type

This commit is contained in:
Nate Sesti 2024-03-18 09:57:32 -07:00
parent e49db6be9d
commit 0c75e4ccd2

View file

@ -50,11 +50,14 @@ class OpenAI extends BaseLLM {
}
const parts = message.content.map((part) => {
return {
const msg: any = {
type: part.type,
text: part.text,
image_url: { ...part.imageUrl, detail: "low" },
};
if (part.type === "imageUrl") {
msg.image_url = { ...part.imageUrl, detail: "low" };
}
return msg;
});
return {
...message,