We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c16e3f commit 7daafe3Copy full SHA for 7daafe3
1 file changed
web/src/llm-api/openai.ts
@@ -110,6 +110,20 @@ export async function handleOpenAIStream({
110
openaiBody.max_completion_tokens ?? openaiBody.max_tokens
111
delete (openaiBody as any).max_tokens
112
113
+ // Transform reasoning to reasoning_effort
114
+ if (openaiBody.reasoning && typeof openaiBody.reasoning === 'object') {
115
+ const reasoning = openaiBody.reasoning as {
116
+ enabled?: boolean
117
+ effort?: 'high' | 'medium' | 'low'
118
+ }
119
+ const enabled = reasoning.enabled ?? true
120
+
121
+ if (enabled) {
122
+ openaiBody.reasoning_effort = reasoning.effort ?? 'medium'
123
124
125
+ delete (openaiBody as any).reasoning
126
127
// Remove fields that OpenAI doesn't support
128
delete (openaiBody as any).stop
129
delete (openaiBody as any).usage
0 commit comments