mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-10 00:50:43 +01:00
webstorm moment
This commit is contained in:
parent
60880cfd4d
commit
5071b9a369
@ -1,7 +1,7 @@
|
|||||||
import {getRequestHeaders} from '../../script.js';
|
import { getRequestHeaders } from '../../script.js';
|
||||||
import {extension_settings} from '../extensions.js';
|
import { extension_settings } from '../extensions.js';
|
||||||
import {SECRET_KEYS, secret_state} from '../secrets.js';
|
import { SECRET_KEYS, secret_state } from '../secrets.js';
|
||||||
import {createThumbnail} from '../utils.js';
|
import { createThumbnail } from '../utils.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a caption for an image using a multimodal model.
|
* Generates a caption for an image using a multimodal model.
|
||||||
|
@ -56,7 +56,7 @@ import {
|
|||||||
resetScrollHeight,
|
resetScrollHeight,
|
||||||
stringFormat,
|
stringFormat,
|
||||||
} from './utils.js';
|
} from './utils.js';
|
||||||
import {countTokensOpenAI, getTokenizerModel} from './tokenizers.js';
|
import { countTokensOpenAI, getTokenizerModel } from './tokenizers.js';
|
||||||
import {
|
import {
|
||||||
formatInstructModeChat,
|
formatInstructModeChat,
|
||||||
formatInstructModeExamples,
|
formatInstructModeExamples,
|
||||||
|
@ -72,12 +72,12 @@ function convertClaudePrompt(messages, addHumanPrefix, addAssistantPostfix, with
|
|||||||
return requestPrompt;
|
return requestPrompt;
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertGooglePrompt(messages, type) {
|
function convertGooglePrompt(messages, model) {
|
||||||
const contents = [];
|
const contents = [];
|
||||||
let lastRole = '';
|
let lastRole = '';
|
||||||
let currentText = '';
|
let currentText = '';
|
||||||
|
|
||||||
const isMultimodal = type === 'gemini-pro-vision';
|
const isMultimodal = model === 'gemini-pro-vision';
|
||||||
|
|
||||||
if (isMultimodal) {
|
if (isMultimodal) {
|
||||||
const combinedText = messages.map((message) => {
|
const combinedText = messages.map((message) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user