mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-03 12:47:35 +01:00
add search functionality for models
This commit is contained in:
parent
00b44071a6
commit
9b17f4e0c0
@ -2876,11 +2876,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<h4>Enter a Model ID</h4>
|
<h4>Enter a Model ID</h4>
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<input id="custom_model_id" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" placeholder="Example: gpt-3.5-turbo">
|
<input list="model_custom_select_fill" id="custom_model_id" class="text_pole wide100p" maxlength="500" value="" autocomplete="off" placeholder="Example: gpt-3.5-turbo">
|
||||||
|
<datalist id="model_custom_select_fill" class="text_pole model_custom_select"></datalist>
|
||||||
</div>
|
</div>
|
||||||
<h4 data-i18n="Available Models">Available Models</h4>
|
<h4 data-i18n="Available Models">Available Models</h4>
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<select id="model_custom_select" class="text_pole"></select>
|
<select class="text_pole model_custom_select"></select>
|
||||||
</div>
|
</div>
|
||||||
<h4 data-i18n="Prompt Post-Processing">Prompt Post-Processing</h4>
|
<h4 data-i18n="Prompt Post-Processing">Prompt Post-Processing</h4>
|
||||||
<select id="custom_prompt_post_processing" class="text_pole" title="Applies additional processing to the prompt before sending it to the API." data-i18n="[title]Applies additional processing to the prompt before sending it to the API.">
|
<select id="custom_prompt_post_processing" class="text_pole" title="Applies additional processing to the prompt before sending it to the API." data-i18n="[title]Applies additional processing to the prompt before sending it to the API.">
|
||||||
|
@ -1539,10 +1539,10 @@ function saveModelList(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oai_settings.chat_completion_source == chat_completion_sources.CUSTOM) {
|
if (oai_settings.chat_completion_source == chat_completion_sources.CUSTOM) {
|
||||||
$('#model_custom_select').empty();
|
$('.model_custom_select').empty();
|
||||||
$('#model_custom_select').append('<option value="">None</option>');
|
$('.model_custom_select').append('<option value="">None</option>');
|
||||||
model_list.forEach((model) => {
|
model_list.forEach((model) => {
|
||||||
$('#model_custom_select').append(
|
$('.model_custom_select').append(
|
||||||
$('<option>', {
|
$('<option>', {
|
||||||
value: model.id,
|
value: model.id,
|
||||||
text: model.id,
|
text: model.id,
|
||||||
@ -1551,7 +1551,7 @@ function saveModelList(data) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!oai_settings.custom_model && model_list.length > 0) {
|
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) {
|
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_url = oai_settings.custom_url;
|
||||||
data.custom_include_headers = oai_settings.custom_include_headers;
|
data.custom_include_headers = oai_settings.custom_include_headers;
|
||||||
}
|
}
|
||||||
@ -3870,7 +3870,7 @@ async function onModelChange() {
|
|||||||
oai_settings.groq_model = value;
|
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);
|
console.log('Custom model changed to', value);
|
||||||
oai_settings.custom_model = value;
|
oai_settings.custom_model = value;
|
||||||
$('#custom_model_id').val(value).trigger('input');
|
$('#custom_model_id').val(value).trigger('input');
|
||||||
@ -4347,7 +4347,7 @@ function toggleChatCompletionForms() {
|
|||||||
$('#model_groq_select').trigger('change');
|
$('#model_groq_select').trigger('change');
|
||||||
}
|
}
|
||||||
else if (oai_settings.chat_completion_source == chat_completion_sources.CUSTOM) {
|
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 () {
|
$('[data-source]').each(function () {
|
||||||
const validSources = $(this).data('source').split(',');
|
const validSources = $(this).data('source').split(',');
|
||||||
@ -5060,7 +5060,7 @@ $(document).ready(async function () {
|
|||||||
$('#model_cohere_select').on('change', onModelChange);
|
$('#model_cohere_select').on('change', onModelChange);
|
||||||
$('#model_perplexity_select').on('change', onModelChange);
|
$('#model_perplexity_select').on('change', onModelChange);
|
||||||
$('#model_groq_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);
|
$('#settings_preset_openai').on('change', onSettingsPresetChange);
|
||||||
$('#new_oai_preset').on('click', onNewPresetClick);
|
$('#new_oai_preset').on('click', onNewPresetClick);
|
||||||
$('#delete_oai_preset').on('click', onDeletePresetClick);
|
$('#delete_oai_preset').on('click', onDeletePresetClick);
|
||||||
|
@ -1146,6 +1146,7 @@ select {
|
|||||||
color: var(--SmartThemeBodyColor);
|
color: var(--SmartThemeBodyColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#send_textarea {
|
#send_textarea {
|
||||||
min-height: calc(var(--bottomFormBlockSize) + 2px);
|
min-height: calc(var(--bottomFormBlockSize) + 2px);
|
||||||
height: calc(var(--bottomFormBlockSize) + 2px);
|
height: calc(var(--bottomFormBlockSize) + 2px);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user