File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,23 @@ export const getRooReasoning = ({
5252 settings,
5353} : GetModelReasoningOptions ) : RooReasoningParams | undefined => {
5454 // Check if model supports reasoning effort
55- if ( ! model . supportsReasoningEffort ) return undefined
55+ if ( ! model . supportsReasoningEffort ) {
56+ return undefined
57+ }
58+
59+ if ( model . requiredReasoningEffort ) {
60+ const providedEffort : GetModelReasoningOptions [ "reasoningEffort" ] = reasoningEffort ?? "medium"
61+ const validEfforts : ReasoningEffortExtended [ ] = [ "low" , "medium" , "high" ]
62+
63+ // Honor the provided effort if it's valid, otherwise default to "medium".
64+ const effectiveEffort : ReasoningEffortExtended = validEfforts . includes (
65+ providedEffort as ReasoningEffortExtended ,
66+ )
67+ ? ( providedEffort as ReasoningEffortExtended )
68+ : "medium"
69+
70+ return { enabled : true , effort : effectiveEffort }
71+ }
5672
5773 // Explicit off switch from settings: always send disabled for back-compat and to
5874 // prevent automatic reasoning when the toggle is turned off.
You can’t perform that action at this time.
0 commit comments