diff --git a/src/lib/components/chat/Settings/Valves.svelte b/src/lib/components/chat/Settings/Valves.svelte
index ca97ade05..579779162 100644
--- a/src/lib/components/chat/Settings/Valves.svelte
+++ b/src/lib/components/chat/Settings/Valves.svelte
@@ -19,6 +19,7 @@
import Tooltip from '$lib/components/common/Tooltip.svelte';
import Spinner from '$lib/components/common/Spinner.svelte';
import Switch from '$lib/components/common/Switch.svelte';
+ import Valves from '$lib/components/common/Valves.svelte';
const dispatch = createEventDispatcher();
@@ -170,91 +171,7 @@
{#if !loading}
- {#if valvesSpec}
- {#each Object.keys(valvesSpec.properties) as property, idx}
-
-
-
- {valvesSpec.properties[property].title}
-
- {#if (valvesSpec?.required ?? []).includes(property)}
- *required
- {/if}
-
-
-
-
-
- {#if (valves[property] ?? null) !== null}
-
-
-
- {#if valvesSpec.properties[property]?.enum ?? null}
-
- {:else if (valvesSpec.properties[property]?.type ?? null) === 'boolean'}
-
-
- {valves[property] ? 'Enabled' : 'Disabled'}
-
-
-
-
-
-
- {:else}
-
- {/if}
-
-
- {/if}
-
- {#if (valvesSpec.properties[property]?.description ?? null) !== null}
-
- {valvesSpec.properties[property].description}
-
- {/if}
-
- {/each}
- {:else}
-
No valves
- {/if}
+
{:else}
{/if}
diff --git a/src/lib/components/common/Valves.svelte b/src/lib/components/common/Valves.svelte
new file mode 100644
index 000000000..f15a4fb23
--- /dev/null
+++ b/src/lib/components/common/Valves.svelte
@@ -0,0 +1,95 @@
+
+
+{#if valvesSpec}
+ {#each Object.keys(valvesSpec.properties) as property, idx}
+
+
+
+ {valvesSpec.properties[property].title}
+
+ {#if (valvesSpec?.required ?? []).includes(property)}
+ *required
+ {/if}
+
+
+
+
+
+ {#if (valves[property] ?? null) !== null}
+
+
+
+ {#if valvesSpec.properties[property]?.enum ?? null}
+
+ {:else if (valvesSpec.properties[property]?.type ?? null) === 'boolean'}
+
+
+ {valves[property] ? 'Enabled' : 'Disabled'}
+
+
+
+
+
+
+ {:else}
+
+ {/if}
+
+
+ {/if}
+
+ {#if (valvesSpec.properties[property]?.description ?? null) !== null}
+
+ {valvesSpec.properties[property].description}
+
+ {/if}
+
+ {/each}
+{:else}
+
No valves
+{/if}
diff --git a/src/lib/components/workspace/common/ValvesModal.svelte b/src/lib/components/workspace/common/ValvesModal.svelte
index 12315f9e6..1f23c510e 100644
--- a/src/lib/components/workspace/common/ValvesModal.svelte
+++ b/src/lib/components/workspace/common/ValvesModal.svelte
@@ -13,6 +13,7 @@
import { getToolValvesById, getToolValvesSpecById, updateToolValvesById } from '$lib/apis/tools';
import Spinner from '../../common/Spinner.svelte';
import Switch from '$lib/components/common/Switch.svelte';
+ import Valves from '$lib/components/common/Valves.svelte';
const i18n = getContext('i18n');
const dispatch = createEventDispatcher();
@@ -127,91 +128,7 @@
>
{#if !loading}
- {#if valvesSpec}
- {#each Object.keys(valvesSpec.properties) as property, idx}
-
-
-
- {valvesSpec.properties[property].title}
-
- {#if (valvesSpec?.required ?? []).includes(property)}
- *required
- {/if}
-
-
-
-
-
- {#if (valves[property] ?? null) !== null}
-
-
-
- {#if valvesSpec.properties[property]?.enum ?? null}
-
- {:else if (valvesSpec.properties[property]?.type ?? null) === 'boolean'}
-
-
- {valves[property] ? 'Enabled' : 'Disabled'}
-
-
-
-
-
-
- {:else}
-
- {/if}
-
-
- {/if}
-
- {#if (valvesSpec.properties[property]?.description ?? null) !== null}
-
- {valvesSpec.properties[property].description}
-
- {/if}
-
- {/each}
- {:else}
-
No valves
- {/if}
+
{:else}
{/if}