File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed
routes/page/agent/[agentId]/agent-components Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -185,4 +185,11 @@ const llmModelType = {
185185 Embedding : 4 ,
186186 Audio : 5
187187} ;
188- export const LlmModelType = Object . freeze ( llmModelType ) ;
188+ export const LlmModelType = Object . freeze ( llmModelType ) ;
189+
190+ const reasoningEffortLevel = {
191+ Low : "low" ,
192+ Medium : "medium" ,
193+ High : "high"
194+ } ;
195+ export const ReasoningEffortLevel = Object . freeze ( reasoningEffortLevel ) ;
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 33 import { Card , CardBody , Input } from ' @sveltestrap/sveltestrap' ;
44 import { getLlmProviders , getLlmProviderModels } from ' $lib/services/llm-provider-service' ;
55 import { INTEGER_REGEX } from ' $lib/helpers/constants' ;
6+ import { ReasoningEffortLevel } from ' $lib/helpers/enums' ;
67
78 /** @type {import('$agentTypes').AgentModel} */
89 export let agent;
1819 }
1920
2021 const recursiveDepthLowerLimit = 1 ;
22+ /** @type {import('$commonTypes').LabelValuePair[]} */
23+ const reasonLevelOptions = [
24+ { value: ' ' , label: ' ' },
25+ ... Object .entries (ReasoningEffortLevel).map (([k , v ]) => ({
26+ value: v,
27+ label: v
28+ }))
29+ ];
2130
2231 let config = agent .llm_config ;
2332
8998 handleAgentChange ();
9099 }
91100
101+ /** @param {any} e */
102+ function changeReasoningEffortLevel (e ) {
103+ config .reasoning_effort_level = e .target .value || null ;
104+ handleAgentChange ();
105+ }
106+
92107 /** @param {any} e */
93108 function validateIntegerInput (e ) {
94109 const reg = new RegExp (INTEGER_REGEX , ' g' );
164179 / >
165180 < / div>
166181 < / div>
182+
183+ < div class = " mb-3 row" >
184+ < label for = " example-text-input" class = " col-md-3 col-form-label" >
185+ Reasoning level
186+ < / label>
187+ < div class = " col-md-9" >
188+ < Input type= " select" value= {config .reasoning_effort_level } on: change= {e => changeReasoningEffortLevel (e)}>
189+ {#each reasonLevelOptions as option}
190+ < option value= {option .value } selected= {option .value == config .reasoning_effort_level }>
191+ {option .label }
192+ < / option>
193+ {/ each}
194+ < / Input>
195+ < / div>
196+ < / div>
167197 < / CardBody>
168198< / Card>
You can’t perform that action at this time.
0 commit comments