Skip to content

Commit bd9a7ff

Browse files
feat(web): add reasoningEffort support for Azure OpenAI provider
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 44e7e62 commit bd9a7ff

File tree

8 files changed

+103
-0
lines changed

8 files changed

+103
-0
lines changed

docs/snippets/schemas/v3/index.schema.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,6 +2058,16 @@
20582058
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
20592059
"description": "Use a different URL prefix for API calls. Either this or `resourceName` can be used."
20602060
},
2061+
"reasoningEffort": {
2062+
"type": "string",
2063+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
2064+
"examples": [
2065+
"minimal",
2066+
"low",
2067+
"medium",
2068+
"high"
2069+
]
2070+
},
20612071
"headers": {
20622072
"type": "object",
20632073
"description": "Optional headers to use with the model.",
@@ -3518,6 +3528,16 @@
35183528
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
35193529
"description": "Use a different URL prefix for API calls. Either this or `resourceName` can be used."
35203530
},
3531+
"reasoningEffort": {
3532+
"type": "string",
3533+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
3534+
"examples": [
3535+
"minimal",
3536+
"low",
3537+
"medium",
3538+
"high"
3539+
]
3540+
},
35213541
"headers": {
35223542
"type": "object",
35233543
"description": "Optional headers to use with the model.",

docs/snippets/schemas/v3/languageModel.schema.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,16 @@
372372
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
373373
"description": "Use a different URL prefix for API calls. Either this or `resourceName` can be used."
374374
},
375+
"reasoningEffort": {
376+
"type": "string",
377+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
378+
"examples": [
379+
"minimal",
380+
"low",
381+
"medium",
382+
"high"
383+
]
384+
},
375385
"headers": {
376386
"type": "object",
377387
"description": "Optional headers to use with the model.",
@@ -1832,6 +1842,16 @@
18321842
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
18331843
"description": "Use a different URL prefix for API calls. Either this or `resourceName` can be used."
18341844
},
1845+
"reasoningEffort": {
1846+
"type": "string",
1847+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
1848+
"examples": [
1849+
"minimal",
1850+
"low",
1851+
"medium",
1852+
"high"
1853+
]
1854+
},
18351855
"headers": {
18361856
"type": "object",
18371857
"description": "Optional headers to use with the model.",

packages/schemas/src/v3/index.schema.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,6 +2057,16 @@ const schema = {
20572057
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
20582058
"description": "Use a different URL prefix for API calls. Either this or `resourceName` can be used."
20592059
},
2060+
"reasoningEffort": {
2061+
"type": "string",
2062+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
2063+
"examples": [
2064+
"minimal",
2065+
"low",
2066+
"medium",
2067+
"high"
2068+
]
2069+
},
20602070
"headers": {
20612071
"type": "object",
20622072
"description": "Optional headers to use with the model.",
@@ -3517,6 +3527,16 @@ const schema = {
35173527
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
35183528
"description": "Use a different URL prefix for API calls. Either this or `resourceName` can be used."
35193529
},
3530+
"reasoningEffort": {
3531+
"type": "string",
3532+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
3533+
"examples": [
3534+
"minimal",
3535+
"low",
3536+
"medium",
3537+
"high"
3538+
]
3539+
},
35203540
"headers": {
35213541
"type": "object",
35223542
"description": "Optional headers to use with the model.",

packages/schemas/src/v3/index.type.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,10 @@ export interface AzureLanguageModel {
868868
* Use a different URL prefix for API calls. Either this or `resourceName` can be used.
869869
*/
870870
baseUrl?: string;
871+
/**
872+
* The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings
873+
*/
874+
reasoningEffort?: string;
871875
headers?: LanguageModelHeaders;
872876
}
873877
export interface DeepSeekLanguageModel {

packages/schemas/src/v3/languageModel.schema.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,16 @@ const schema = {
371371
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
372372
"description": "Use a different URL prefix for API calls. Either this or `resourceName` can be used."
373373
},
374+
"reasoningEffort": {
375+
"type": "string",
376+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
377+
"examples": [
378+
"minimal",
379+
"low",
380+
"medium",
381+
"high"
382+
]
383+
},
374384
"headers": {
375385
"type": "object",
376386
"description": "Optional headers to use with the model.",
@@ -1831,6 +1841,16 @@ const schema = {
18311841
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
18321842
"description": "Use a different URL prefix for API calls. Either this or `resourceName` can be used."
18331843
},
1844+
"reasoningEffort": {
1845+
"type": "string",
1846+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
1847+
"examples": [
1848+
"minimal",
1849+
"low",
1850+
"medium",
1851+
"high"
1852+
]
1853+
},
18341854
"headers": {
18351855
"type": "object",
18361856
"description": "Optional headers to use with the model.",

packages/schemas/src/v3/languageModel.type.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ export interface AzureLanguageModel {
202202
* Use a different URL prefix for API calls. Either this or `resourceName` can be used.
203203
*/
204204
baseUrl?: string;
205+
/**
206+
* The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings
207+
*/
208+
reasoningEffort?: string;
205209
headers?: LanguageModelHeaders;
206210
}
207211
export interface DeepSeekLanguageModel {

packages/web/src/features/chat/utils.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ export const getAISDKLanguageModelAndOptions = async (config: LanguageModel): Pr
234234

235235
return {
236236
model: azure(modelId),
237+
providerOptions: {
238+
openai: {
239+
reasoningEffort: config.reasoningEffort ?? 'medium',
240+
} satisfies OpenAIResponsesProviderOptions,
241+
}
237242
};
238243
}
239244
case 'deepseek': {

schemas/v3/languageModel.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@
126126
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
127127
"description": "Use a different URL prefix for API calls. Either this or `resourceName` can be used."
128128
},
129+
"reasoningEffort": {
130+
"type": "string",
131+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
132+
"examples": [
133+
"minimal",
134+
"low",
135+
"medium",
136+
"high"
137+
]
138+
},
129139
"headers": {
130140
"$ref": "./shared.json#/definitions/LanguageModelHeaders"
131141
}

0 commit comments

Comments
 (0)