mirror of
https://github.com/open-webui/open-webui
synced 2025-04-03 20:41:29 +00:00
handle empty valves
This commit is contained in:
parent
3bc97cf3fb
commit
078f025830
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
export let filters = [];
|
export let filters = [];
|
||||||
export let selectedFilterIds = [];
|
export let selectedFilterIds = [];
|
||||||
|
|
||||||
export let valvesSpecs = {};
|
export let valvesSpecs = {};
|
||||||
export let valves = {};
|
export let valves = {};
|
||||||
|
|
||||||
@ -69,7 +69,6 @@
|
|||||||
>
|
>
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
<Valves valvesSpec={valvesSpecs[filter]} bind:valves={valves[filter]} />
|
<Valves valvesSpec={valvesSpecs[filter]} bind:valves={valves[filter]} />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</Collapsible>
|
</Collapsible>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -67,7 +67,11 @@
|
|||||||
profile_image_url: '/static/favicon.png',
|
profile_image_url: '/static/favicon.png',
|
||||||
description: '',
|
description: '',
|
||||||
suggestion_prompts: null,
|
suggestion_prompts: null,
|
||||||
tags: []
|
tags: [],
|
||||||
|
valves: {
|
||||||
|
functions: {},
|
||||||
|
tools: {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
system: ''
|
system: ''
|
||||||
@ -174,6 +178,16 @@
|
|||||||
delete info.params[key];
|
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);
|
await onSubmit(info);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user