mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add basic WindowAI support
This commit is contained in:
@ -90,6 +90,7 @@ import {
|
|||||||
openai_messages_count,
|
openai_messages_count,
|
||||||
getTokenCountOpenAI,
|
getTokenCountOpenAI,
|
||||||
chat_completion_sources,
|
chat_completion_sources,
|
||||||
|
setupWindowAiPromptManager,
|
||||||
setupClaudePromptManager,
|
setupClaudePromptManager,
|
||||||
getTokenizerModel,
|
getTokenizerModel,
|
||||||
getChatCompletionModel,
|
getChatCompletionModel,
|
||||||
@ -4541,6 +4542,10 @@ function changeMainAPI() {
|
|||||||
console.log('Setting up Claude prompt manager');
|
console.log('Setting up Claude prompt manager');
|
||||||
setupClaudePromptManager(oai_settings);
|
setupClaudePromptManager(oai_settings);
|
||||||
break;
|
break;
|
||||||
|
case chat_completion_sources.WINDOWAI:
|
||||||
|
console.log('Setting up WindowAI prompt manager');
|
||||||
|
setupWindowAiPromptManager(oai_settings);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ export {
|
|||||||
setOpenAIMessageExamples,
|
setOpenAIMessageExamples,
|
||||||
setupOpenAIPromptManager,
|
setupOpenAIPromptManager,
|
||||||
setupClaudePromptManager,
|
setupClaudePromptManager,
|
||||||
|
setupWindowAiPromptManager,
|
||||||
generateOpenAIPromptCache,
|
generateOpenAIPromptCache,
|
||||||
prepareOpenAIMessages,
|
prepareOpenAIMessages,
|
||||||
sendOpenAIRequest,
|
sendOpenAIRequest,
|
||||||
@ -305,6 +306,10 @@ function setupClaudePromptManager(claudeSettings) {
|
|||||||
setupOpenAIPromptManager(claudeSettings);
|
setupOpenAIPromptManager(claudeSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setupWindowAiPromptManager(windowAiSettings) {
|
||||||
|
setupOpenAIPromptManager(windowAiSettings);
|
||||||
|
}
|
||||||
|
|
||||||
function generateOpenAIPromptCache() {
|
function generateOpenAIPromptCache() {
|
||||||
openai_msgs = openai_msgs.reverse();
|
openai_msgs = openai_msgs.reverse();
|
||||||
openai_msgs.forEach(function (msg, i, arr) {
|
openai_msgs.forEach(function (msg, i, arr) {
|
||||||
|
Reference in New Issue
Block a user