Add basic WindowAI support

This commit is contained in:
maver 2023-06-25 19:01:09 +02:00
parent 5c18abadac
commit f207e0eab3
2 changed files with 10 additions and 0 deletions

View File

@ -90,6 +90,7 @@ import {
openai_messages_count,
getTokenCountOpenAI,
chat_completion_sources,
setupWindowAiPromptManager,
setupClaudePromptManager,
getTokenizerModel,
getChatCompletionModel,
@ -4541,6 +4542,10 @@ function changeMainAPI() {
console.log('Setting up Claude prompt manager');
setupClaudePromptManager(oai_settings);
break;
case chat_completion_sources.WINDOWAI:
console.log('Setting up WindowAI prompt manager');
setupWindowAiPromptManager(oai_settings);
break;
}
}

View File

@ -62,6 +62,7 @@ export {
setOpenAIMessageExamples,
setupOpenAIPromptManager,
setupClaudePromptManager,
setupWindowAiPromptManager,
generateOpenAIPromptCache,
prepareOpenAIMessages,
sendOpenAIRequest,
@ -305,6 +306,10 @@ function setupClaudePromptManager(claudeSettings) {
setupOpenAIPromptManager(claudeSettings);
}
function setupWindowAiPromptManager(windowAiSettings) {
setupOpenAIPromptManager(windowAiSettings);
}
function generateOpenAIPromptCache() {
openai_msgs = openai_msgs.reverse();
openai_msgs.forEach(function (msg, i, arr) {