mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
add search functionality for models
This commit is contained in:
@ -1539,10 +1539,10 @@ function saveModelList(data) {
|
||||
}
|
||||
|
||||
if (oai_settings.chat_completion_source == chat_completion_sources.CUSTOM) {
|
||||
$('#model_custom_select').empty();
|
||||
$('#model_custom_select').append('<option value="">None</option>');
|
||||
$('.model_custom_select').empty();
|
||||
$('.model_custom_select').append('<option value="">None</option>');
|
||||
model_list.forEach((model) => {
|
||||
$('#model_custom_select').append(
|
||||
$('.model_custom_select').append(
|
||||
$('<option>', {
|
||||
value: model.id,
|
||||
text: model.id,
|
||||
@ -1551,7 +1551,7 @@ function saveModelList(data) {
|
||||
});
|
||||
|
||||
if (!oai_settings.custom_model && model_list.length > 0) {
|
||||
$('#model_custom_select').val(model_list[0].id).trigger('change');
|
||||
$('.model_custom_select').val(model_list[0].id).trigger('change');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3152,7 +3152,7 @@ async function getStatusOpen() {
|
||||
}
|
||||
|
||||
if (oai_settings.chat_completion_source === chat_completion_sources.CUSTOM) {
|
||||
$('#model_custom_select').empty();
|
||||
$('.model_custom_select').empty();
|
||||
data.custom_url = oai_settings.custom_url;
|
||||
data.custom_include_headers = oai_settings.custom_include_headers;
|
||||
}
|
||||
@ -3870,7 +3870,7 @@ async function onModelChange() {
|
||||
oai_settings.groq_model = value;
|
||||
}
|
||||
|
||||
if (value && $(this).is('#model_custom_select')) {
|
||||
if (value && $(this).is('.model_custom_select')) {
|
||||
console.log('Custom model changed to', value);
|
||||
oai_settings.custom_model = value;
|
||||
$('#custom_model_id').val(value).trigger('input');
|
||||
@ -4347,7 +4347,7 @@ function toggleChatCompletionForms() {
|
||||
$('#model_groq_select').trigger('change');
|
||||
}
|
||||
else if (oai_settings.chat_completion_source == chat_completion_sources.CUSTOM) {
|
||||
$('#model_custom_select').trigger('change');
|
||||
$('.model_custom_select').trigger('change');
|
||||
}
|
||||
$('[data-source]').each(function () {
|
||||
const validSources = $(this).data('source').split(',');
|
||||
@ -5060,7 +5060,7 @@ $(document).ready(async function () {
|
||||
$('#model_cohere_select').on('change', onModelChange);
|
||||
$('#model_perplexity_select').on('change', onModelChange);
|
||||
$('#model_groq_select').on('change', onModelChange);
|
||||
$('#model_custom_select').on('change', onModelChange);
|
||||
$('.model_custom_select').on('change', onModelChange);
|
||||
$('#settings_preset_openai').on('change', onSettingsPresetChange);
|
||||
$('#new_oai_preset').on('click', onNewPresetClick);
|
||||
$('#delete_oai_preset').on('click', onDeletePresetClick);
|
||||
|
Reference in New Issue
Block a user