🐛 don't send image_url if not image type
This commit is contained in:
parent
e49db6be9d
commit
0c75e4ccd2
1 changed files with 5 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue