mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Implement Data Bank vectors querying
This commit is contained in:
		@@ -757,7 +757,7 @@ async function openAttachmentManager() {
 | 
			
		||||
 */
 | 
			
		||||
async function openWebpageScraper(target, callback) {
 | 
			
		||||
    const template = $(await renderExtensionTemplateAsync('attachments', 'web-scrape', {}));
 | 
			
		||||
    const link = await callGenericPopup(template, POPUP_TYPE.INPUT, '', { wide: false, large: false });
 | 
			
		||||
    const link = await callGenericPopup(template, POPUP_TYPE.INPUT, '', { wide: false, large: false, okButton: 'Scrape', cancelButton: 'Cancel' });
 | 
			
		||||
 | 
			
		||||
    if (!link) {
 | 
			
		||||
        return;
 | 
			
		||||
@@ -825,7 +825,7 @@ async function openFandomScraper(target, callback) {
 | 
			
		||||
        output = String($(this).val());
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const confirm = await callGenericPopup(template, POPUP_TYPE.CONFIRM, '', { wide: false, large: false });
 | 
			
		||||
    const confirm = await callGenericPopup(template, POPUP_TYPE.CONFIRM, '', { wide: false, large: false, okButton: 'Scrape', cancelButton: 'Cancel' });
 | 
			
		||||
 | 
			
		||||
    if (confirm !== POPUP_RESULT.AFFIRMATIVE) {
 | 
			
		||||
        return;
 | 
			
		||||
@@ -994,6 +994,19 @@ function ensureAttachmentsExist() {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets all currently available attachments.
 | 
			
		||||
 * @returns {FileAttachment[]} List of attachments
 | 
			
		||||
 */
 | 
			
		||||
export function getDataBankAttachments() {
 | 
			
		||||
    ensureAttachmentsExist();
 | 
			
		||||
    const globalAttachments = extension_settings.attachments ?? [];
 | 
			
		||||
    const chatAttachments = chat_metadata.attachments ?? [];
 | 
			
		||||
    const characterAttachments = characters[this_chid]?.data?.extensions?.attachments ?? [];
 | 
			
		||||
 | 
			
		||||
    return [...globalAttachments, ...chatAttachments, ...characterAttachments];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Probes the server to check if the Fandom plugin is available.
 | 
			
		||||
 * @returns {Promise<boolean>} True if the plugin is available, false otherwise.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user