Skip to content

Commit ea81611

Browse files
author
Jicheng Lu
committed
add reasoning effort level
1 parent c708a71 commit ea81611

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

src/lib/helpers/types/agentTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* @property {string?} model
1818
* @property {number} max_recursion_depth
1919
* @property {number?} [max_output_tokens]
20+
* @property {string?} [reasoning_effort_level]
2021
*/
2122

2223

src/routes/page/agent/[agentId]/agent-components/agent-knowledge-base.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@
8787
const found = innerKnowledgeBases.find((_, index) => index === idx);
8888
if (!found) return;
8989
90-
const vals = e.target.value.split("#");
91-
found.name = vals[0];
92-
found.type = vals[1];
90+
const val = JSON.parse(e.target.value);
91+
found.name = val?.name;
92+
found.type = val?.type;
9393
innerRefresh(innerKnowledgeBases);
9494
handleAgentChange();
9595
}
@@ -219,7 +219,7 @@
219219
on:change={e => changeKnowledgeBase(e, uid)}
220220
>
221221
{#each [...knowledgeBaseOptions] as option}
222-
<option value={`${option.name}#${option.type}`} selected={option.name == knowledge.name}>
222+
<option value={`${JSON.stringify(option)}`} selected={option.name == knowledge.name}>
223223
{option.displayName || option.name}
224224
</option>
225225
{/each}

src/routes/page/agent/[agentId]/agent-components/agent-llm-config.svelte

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
handleAgentChange();
100100
}
101101
102+
/** @param {any} e */
103+
function changeReasoningEffortLevel(e) {
104+
config.reasoning_effort_level = e.target.value || null;
105+
handleAgentChange();
106+
}
107+
102108
/** @param {any} e */
103109
function validateIntegerInput(e) {
104110
const reg = new RegExp(INTEGER_REGEX, 'g');
@@ -174,5 +180,20 @@
174180
/>
175181
</div>
176182
</div>
183+
184+
<div class="mb-3 row">
185+
<label for="example-text-input" class="col-md-3 col-form-label">
186+
Reasoning level
187+
</label>
188+
<div class="col-md-9">
189+
<Input type="select" value={config.reasoning_effort_level} on:change={e => changeReasoningEffortLevel(e)}>
190+
{#each reasonLevelOptions as option}
191+
<option value={option.value} selected={option.value == config.reasoning_effort_level}>
192+
{option.label}
193+
</option>
194+
{/each}
195+
</Input>
196+
</div>
197+
</div>
177198
</CardBody>
178199
</Card>

0 commit comments

Comments
 (0)