mirror of
https://github.com/open-webui/open-webui
synced 2025-04-02 12:09:06 +00:00
handle empty valves
This commit is contained in:
parent
3bc97cf3fb
commit
078f025830
@ -9,7 +9,7 @@
|
||||
|
||||
export let filters = [];
|
||||
export let selectedFilterIds = [];
|
||||
|
||||
|
||||
export let valvesSpecs = {};
|
||||
export let valves = {};
|
||||
|
||||
@ -69,7 +69,6 @@
|
||||
>
|
||||
<div slot="content">
|
||||
<Valves valvesSpec={valvesSpecs[filter]} bind:valves={valves[filter]} />
|
||||
|
||||
</div>
|
||||
</Collapsible>
|
||||
{/if}
|
||||
|
@ -67,7 +67,11 @@
|
||||
profile_image_url: '/static/favicon.png',
|
||||
description: '',
|
||||
suggestion_prompts: null,
|
||||
tags: []
|
||||
tags: [],
|
||||
valves: {
|
||||
functions: {},
|
||||
tools: {}
|
||||
}
|
||||
},
|
||||
params: {
|
||||
system: ''
|
||||
@ -174,6 +178,16 @@
|
||||
delete info.params[key];
|
||||
}
|
||||
});
|
||||
// iterate through all valve settings for both functions and tools, and remove empty settings (aka things that got set back to default)
|
||||
Object.keys(info.meta.valves).forEach((valveType) => {
|
||||
Object.keys(info.meta.valves[valveType]).forEach((functionId) => {
|
||||
Object.keys(info.meta.valves[valveType][functionId]).forEach((key) => {
|
||||
if (info.meta.valves[valveType][functionId][key] === null) {
|
||||
delete info.meta.valves.functions[functionId][key];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
await onSubmit(info);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user