mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Remove model name check in convertGooglePrompt
This commit is contained in:
@ -362,22 +362,12 @@ export function convertCohereMessages(messages, names) {
|
||||
/**
|
||||
* Convert a prompt from the ChatML objects to the format used by Google MakerSuite models.
|
||||
* @param {object[]} messages Array of messages
|
||||
* @param {string} model Model name
|
||||
* @param {string} _model Model name
|
||||
* @param {boolean} useSysPrompt Use system prompt
|
||||
* @param {PromptNames} names Prompt names
|
||||
* @returns {{contents: *[], system_instruction: {parts: {text: string}[]}}} Prompt for Google MakerSuite models
|
||||
*/
|
||||
export function convertGooglePrompt(messages, model, useSysPrompt, names) {
|
||||
const visionSupportedModelPrefix = [
|
||||
'gemini-1.5',
|
||||
'gemini-2.0',
|
||||
'gemini-2.5',
|
||||
'gemini-exp-1114',
|
||||
'gemini-exp-1121',
|
||||
'gemini-exp-1206',
|
||||
];
|
||||
|
||||
const isMultimodal = visionSupportedModelPrefix.some(prefix => model.startsWith(prefix));
|
||||
export function convertGooglePrompt(messages, _model, useSysPrompt, names) {
|
||||
const sysPrompt = [];
|
||||
|
||||
if (useSysPrompt) {
|
||||
@ -477,7 +467,7 @@ export function convertGooglePrompt(messages, model, useSysPrompt, names) {
|
||||
|
||||
toolNameMap[toolCall.id] = toolCall.function.name;
|
||||
});
|
||||
} else if (part.type === 'image_url' && isMultimodal) {
|
||||
} else if (part.type === 'image_url') {
|
||||
const mimeType = part.image_url.url.split(';')[0].split(':')[1];
|
||||
const base64Data = part.image_url.url.split(',')[1];
|
||||
parts.push({
|
||||
|
Reference in New Issue
Block a user