diff --git a/src/lib/components/chat/Settings/Advanced/CustomParams.svelte b/src/lib/components/chat/Settings/Advanced/CustomParams.svelte index fb01266303..1e0fb4f921 100644 --- a/src/lib/components/chat/Settings/Advanced/CustomParams.svelte +++ b/src/lib/components/chat/Settings/Advanced/CustomParams.svelte @@ -1,18 +1,70 @@
+ + {#each Object.keys(suggestions) as name} + {#if !Object.hasOwn(value ?? {}, name)} + + {/if} + {/each} +
- {#each Object.keys(value ?? {}) as key} + {#each Object.keys(value ?? {}) as key, index} + {@const options = Object.hasOwn(suggestions, key) ? suggestions[key] : []}
{ @@ -54,10 +108,19 @@ ? 'w-full min-w-0 bg-transparent py-1 text-[0.8125rem] text-gray-700 outline-none placeholder:text-gray-300 dark:text-gray-300 dark:placeholder:text-gray-700' : 'w-full min-w-0 bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none'} aria-label={$i18n.t('Custom Parameter Value')} + list={options.length ? `${id}-values-${index}` : undefined} + autocomplete="off" placeholder={compact ? $i18n.t('e.g. 0.7') : $i18n.t('Custom Parameter Value')} value={typeof value[key] === 'object' ? JSON.stringify(value[key]) : value[key]} on:input={(event) => (value = { ...value, [key]: event.currentTarget.value })} /> + {#if options.length} + + {#each options as option} + + {/each} + + {/if}