Add assistant multimodal handling for gemini
This commit is contained in:
@@ -1687,7 +1687,7 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
|
|||||||
chat.role === 'assistant' ? 'MODEL' :
|
chat.role === 'assistant' ? 'MODEL' :
|
||||||
chat.role
|
chat.role
|
||||||
|
|
||||||
if (chat.multimodals && chat.multimodals.length > 0 && chat.role === "user") {
|
if (chat.multimodals && chat.multimodals.length > 0) {
|
||||||
let geminiParts: GeminiPart[] = [];
|
let geminiParts: GeminiPart[] = [];
|
||||||
|
|
||||||
geminiParts.push({
|
geminiParts.push({
|
||||||
@@ -1714,7 +1714,7 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
|
|||||||
}
|
}
|
||||||
|
|
||||||
reformatedChat.push({
|
reformatedChat.push({
|
||||||
role: "USER",
|
role: chat.role === 'user' ? 'USER' : 'MODEL',
|
||||||
parts: geminiParts,
|
parts: geminiParts,
|
||||||
});
|
});
|
||||||
} else if (prevChat?.role === qRole) {
|
} else if (prevChat?.role === qRole) {
|
||||||
|
|||||||
Reference in New Issue
Block a user