mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add openrouter to /api slash command
This commit is contained in:
@@ -6743,6 +6743,11 @@ function connectAPISlash(_, text) {
|
|||||||
source: 'windowai',
|
source: 'windowai',
|
||||||
button: '#api_button_openai',
|
button: '#api_button_openai',
|
||||||
},
|
},
|
||||||
|
'openrouter': {
|
||||||
|
selected: 'openai',
|
||||||
|
source: 'openrouter',
|
||||||
|
button: '#api_button_openai',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const apiConfig = apiMap[text];
|
const apiConfig = apiMap[text];
|
||||||
@@ -6751,11 +6756,11 @@ function connectAPISlash(_, text) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#main_api option[value='" + (apiConfig.selected || text) + "']").prop("selected", true);
|
$(`#main_api option[value='${apiConfig.selected || text}']`).prop("selected", true);
|
||||||
$("#main_api").trigger('change');
|
$("#main_api").trigger('change');
|
||||||
|
|
||||||
if (apiConfig.source) {
|
if (apiConfig.source) {
|
||||||
$("#chat_completion_source option[value='" + apiConfig.source + "']").prop("selected", true);
|
$(`#chat_completion_source option[value='${apiConfig.source}']`).prop("selected", true);
|
||||||
$("#chat_completion_source").trigger('change');
|
$("#chat_completion_source").trigger('change');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user