mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix Gemini captioning
This commit is contained in:
@ -65,6 +65,7 @@
|
||||
<option data-type="anthropic" value="claude-3-opus-20240229">claude-3-opus-20240229</option>
|
||||
<option data-type="anthropic" value="claude-3-sonnet-20240229">claude-3-sonnet-20240229</option>
|
||||
<option data-type="anthropic" value="claude-3-haiku-20240307">claude-3-haiku-20240307</option>
|
||||
<option data-type="google" value="gemini-2.5-pro-preview-03-25">gemini-2.5-pro-preview-03-25</option>
|
||||
<option data-type="google" value="gemini-2.5-pro-exp-03-25">gemini-2.5-pro-exp-03-25</option>
|
||||
<option data-type="google" value="gemini-2.0-pro-exp">gemini-2.0-pro-exp</option>
|
||||
<option data-type="google" value="gemini-2.0-pro-exp-02-05">gemini-2.0-pro-exp-02-05</option>
|
||||
|
@ -16,7 +16,7 @@ router.post('/caption-image', async (request, response) => {
|
||||
const base64Data = request.body.image.split(',')[1];
|
||||
const apiKey = request.body.reverse_proxy ? request.body.proxy_password : readSecret(request.user.directories, SECRET_KEYS.MAKERSUITE);
|
||||
const apiUrl = new URL(request.body.reverse_proxy || API_MAKERSUITE);
|
||||
const model = request.body.model || 'gemini-pro-vision';
|
||||
const model = request.body.model || 'gemini-2.0-flash';
|
||||
const url = `${apiUrl.origin}/v1beta/models/${model}:generateContent?key=${apiKey}`;
|
||||
const body = {
|
||||
contents: [{
|
||||
@ -30,7 +30,6 @@ router.post('/caption-image', async (request, response) => {
|
||||
}],
|
||||
}],
|
||||
safetySettings: GEMINI_SAFETY,
|
||||
generationConfig: { maxOutputTokens: 1000 },
|
||||
};
|
||||
|
||||
console.debug('Multimodal captioning request', model, body);
|
||||
|
@ -360,6 +360,7 @@ export function convertCohereMessages(messages, names) {
|
||||
*/
|
||||
export function convertGooglePrompt(messages, model, useSysPrompt, names) {
|
||||
const visionSupportedModels = [
|
||||
'gemini-2.5-pro-preview-03-25',
|
||||
'gemini-2.5-pro-exp-03-25',
|
||||
'gemini-2.0-pro-exp',
|
||||
'gemini-2.0-pro-exp-02-05',
|
||||
|
Reference in New Issue
Block a user