mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Gemini inline video (#4078)
* Add inline video attachment support for Gemini 2.5 Pro * file formatting * removed redundant function for saving video to message * removed other redundant function for saving video to message * Seperate inlining check for video * Edit video token cost to be a conservative estimate of 10000 tokens * fixed missing semicolon * Adds seperate ui toggle for video inlining. * Move mes_video out of img_container * Remove title from video element for now * Better visibilty of video with controls --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
This commit is contained in:
@@ -211,6 +211,12 @@ export async function populateFileAttachment(message, inputId = 'file_form_input
|
||||
const imageUrl = await saveBase64AsFile(base64Data, name2, fileNamePrefix, extension);
|
||||
message.extra.image = imageUrl;
|
||||
message.extra.inline_image = true;
|
||||
}
|
||||
// If file is video
|
||||
else if (file.type.startsWith('video/')) {
|
||||
const extension = file.type.split('/')[1];
|
||||
const videoUrl = await saveBase64AsFile(base64Data, name2, fileNamePrefix, extension);
|
||||
message.extra.video = videoUrl;
|
||||
} else {
|
||||
const uniqueFileName = `${fileNamePrefix}.txt`;
|
||||
|
||||
@@ -1240,7 +1246,7 @@ async function openAttachmentManager() {
|
||||
|
||||
return () => {
|
||||
modalButtonData.forEach(p => {
|
||||
const { popper,bodyListener } = p;
|
||||
const { popper, bodyListener } = p;
|
||||
popper.destroy();
|
||||
document.body.removeEventListener('click', bodyListener);
|
||||
});
|
||||
|
Reference in New Issue
Block a user