mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add basic claude support
This commit is contained in:
@ -61,6 +61,7 @@ export {
|
||||
setOpenAIMessages,
|
||||
setOpenAIMessageExamples,
|
||||
setupOpenAIPromptManager,
|
||||
setupClaudePromptManager,
|
||||
generateOpenAIPromptCache,
|
||||
prepareOpenAIMessages,
|
||||
sendOpenAIRequest,
|
||||
@ -278,9 +279,9 @@ function setOpenAIMessageExamples(mesExamplesArray) {
|
||||
function setupOpenAIPromptManager(openAiSettings) {
|
||||
promptManager = new PromptManager();
|
||||
const configuration = {
|
||||
prefix: 'openai_',
|
||||
containerIdentifier: 'openai_prompt_manager',
|
||||
listIdentifier: 'openai_prompt_manager_list',
|
||||
prefix: 'completion_',
|
||||
containerIdentifier: 'completion_prompt_manager',
|
||||
listIdentifier: 'completion_prompt_manager_list',
|
||||
toggleDisabled: ['main'],
|
||||
draggable: true
|
||||
};
|
||||
@ -299,6 +300,10 @@ function setupOpenAIPromptManager(openAiSettings) {
|
||||
promptManager.render();
|
||||
}
|
||||
|
||||
function setupClaudePromptManager(claudeSettings) {
|
||||
setupOpenAIPromptManager(claudeSettings);
|
||||
}
|
||||
|
||||
function generateOpenAIPromptCache() {
|
||||
openai_msgs = openai_msgs.reverse();
|
||||
openai_msgs.forEach(function (msg, i, arr) {
|
||||
@ -2086,6 +2091,7 @@ async function onModelChange() {
|
||||
if ($(this).is('#model_claude_select')) {
|
||||
console.log('Claude model changed to', value);
|
||||
oai_settings.claude_model = value;
|
||||
//setupOpenAIPromptManager(openai_settings);
|
||||
}
|
||||
|
||||
if ($(this).is('#model_windowai_select')) {
|
||||
@ -2096,6 +2102,7 @@ async function onModelChange() {
|
||||
if ($(this).is('#model_openai_select')) {
|
||||
console.log('OpenAI model changed to', value);
|
||||
oai_settings.openai_model = value;
|
||||
setupOpenAIPromptManager(openai_settings);
|
||||
}
|
||||
|
||||
if ($(this).is('#model_openrouter_select')) {
|
||||
|
Reference in New Issue
Block a user