mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Pollinations - Text (#3985)
* [wip] Pollinations for text * Implement generate API request * Determine Pollinations model tools via models list * Add Pollinations option to /model command * Add Pollinations support to caption * Update link to pollinations site * Fix type errors in openai.js * Fix API connection test to use AbortController for request cancellation * Remove hard coded list of pollinations vision models * Remove openai-audio from captioning models
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { DOMPurify } from '../lib.js';
|
||||
|
||||
import { addOneMessage, chat, event_types, eventSource, main_api, saveChatConditional, system_avatar, systemUserName } from '../script.js';
|
||||
import { chat_completion_sources, oai_settings } from './openai.js';
|
||||
import { chat_completion_sources, model_list, oai_settings } from './openai.js';
|
||||
import { Popup } from './popup.js';
|
||||
import { SlashCommand } from './slash-commands/SlashCommand.js';
|
||||
import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from './slash-commands/SlashCommandArgument.js';
|
||||
@ -575,6 +575,13 @@ export class ToolManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (oai_settings.chat_completion_source === chat_completion_sources.POLLINATIONS && Array.isArray(model_list)) {
|
||||
const currentModel = model_list.find(model => model.id === oai_settings.pollinations_model);
|
||||
if (currentModel) {
|
||||
return currentModel.tools;
|
||||
}
|
||||
}
|
||||
|
||||
const supportedSources = [
|
||||
chat_completion_sources.OPENAI,
|
||||
chat_completion_sources.CUSTOM,
|
||||
@ -587,6 +594,7 @@ export class ToolManager {
|
||||
chat_completion_sources.MAKERSUITE,
|
||||
chat_completion_sources.AI21,
|
||||
chat_completion_sources.XAI,
|
||||
chat_completion_sources.POLLINATIONS,
|
||||
];
|
||||
return supportedSources.includes(oai_settings.chat_completion_source);
|
||||
}
|
||||
|
Reference in New Issue
Block a user