Remove model name check in convertGooglePrompt

e621f0d967d94d8c2c984dd7261759fa1c96783d

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -13Ignore whitespace
src/prompt-converters.js+3 -13
@@ -362,22 +362,12 @@ export function convertCohereMessages(messages, names) {
362/**362/**
363 * Convert a prompt from the ChatML objects to the format used by Google MakerSuite models.363 * Convert a prompt from the ChatML objects to the format used by Google MakerSuite models.
364 * @param {object[]} messages Array of messages364 * @param {object[]} messages Array of messages
365 * @param {string} model Model name365 * @param {string} _model Model name
366 * @param {boolean} useSysPrompt Use system prompt366 * @param {boolean} useSysPrompt Use system prompt
367 * @param {PromptNames} names Prompt names367 * @param {PromptNames} names Prompt names
368 * @returns {{contents: *[], system_instruction: {parts: {text: string}[]}}} Prompt for Google MakerSuite models368 * @returns {{contents: *[], system_instruction: {parts: {text: string}[]}}} Prompt for Google MakerSuite models
369 */369 */
370export function convertGooglePrompt(messages, model, useSysPrompt, names) {370export function convertGooglePrompt(messages, _model, useSysPrompt, names) {
371 const visionSupportedModelPrefix = [
372 'gemini-1.5',
373 'gemini-2.0',
374 'gemini-2.5',
375 'gemini-exp-1114',
376 'gemini-exp-1121',
377 'gemini-exp-1206',
378 ];
379
380 const isMultimodal = visionSupportedModelPrefix.some(prefix => model.startsWith(prefix));
381 const sysPrompt = [];371 const sysPrompt = [];
382372
383 if (useSysPrompt) {373 if (useSysPrompt) {
@@ -477,7 +467,7 @@ export function convertGooglePrompt(messages, model, useSysPrompt, names) {
477467
478 toolNameMap[toolCall.id] = toolCall.function.name;468 toolNameMap[toolCall.id] = toolCall.function.name;
479 });469 });
480 } else if (part.type === 'image_url' && isMultimodal) {470 } else if (part.type === 'image_url') {
481 const mimeType = part.image_url.url.split(';')[0].split(':')[1];471 const mimeType = part.image_url.url.split(';')[0].split(':')[1];
482 const base64Data = part.image_url.url.split(',')[1];472 const base64Data = part.image_url.url.split(',')[1];
483 parts.push({473 parts.push({