Render prompt manager when switching APIs

This commit is contained in:
Cohee 2024-01-01 17:06:10 +02:00
parent 908bf7a61d
commit 9106696f2f
2 changed files with 5 additions and 15 deletions

View File

@ -5452,20 +5452,7 @@ function changeMainAPI() {
getHordeModels();
}
switch (oai_settings.chat_completion_source) {
case chat_completion_sources.SCALE:
case chat_completion_sources.OPENROUTER:
case chat_completion_sources.WINDOWAI:
case chat_completion_sources.CLAUDE:
case chat_completion_sources.OPENAI:
case chat_completion_sources.AI21:
case chat_completion_sources.MAKERSUITE:
case chat_completion_sources.MISTRALAI:
case chat_completion_sources.CUSTOM:
default:
setupChatCompletionPromptManager(oai_settings);
break;
}
}
////////////////////////////////////////////////////

View File

@ -482,7 +482,10 @@ function setOpenAIMessageExamples(mesExamplesArray) {
*/
function setupChatCompletionPromptManager(openAiSettings) {
// Do not set up prompt manager more than once
if (promptManager) return promptManager;
if (promptManager) {
promptManager.render(false);
return promptManager;
}
promptManager = new PromptManager();