Skip to content

Commit 339a184

Browse files
feat(web): add reasoningEffort support for Azure OpenAI provider (#1101)
* feat(web): add reasoningEffort support for Azure OpenAI provider Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add CHANGELOG entry for Azure reasoningEffort support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 44e7e62 commit 339a184

10 files changed

Lines changed: 110 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111
- Linear issue links in chat responses now render as a rich card-style UI showing the Linear logo, issue identifier, and title instead of plain hyperlinks. [#1060](https://github.com/sourcebot-dev/sourcebot/pull/1060)
12+
- Added `reasoningEffort` configuration option for the Azure OpenAI provider. [#1101](https://github.com/sourcebot-dev/sourcebot/pull/1101)
1213

1314
### Changed
1415
- Links in Ask Sourcebot chat responses now open in a new tab with a subtle external link icon indicator. [#1059](https://github.com/sourcebot-dev/sourcebot/pull/1059)

docs/docs/configuration/language-model-providers.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,23 @@ For a detailed description of all the providers, please refer to the [schema](ht
107107

108108
[Vercel AI SDK Azure OpenAI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/azure)
109109

110+
The `model` field should be set to your Azure OpenAI deployment name. Either `resourceName` or `baseUrl` must be set. The `resourceName` is used to construct the URL `https://{resourceName}.openai.azure.com/openai/v1{path}`. If `baseUrl` is provided, `resourceName` is ignored.
111+
110112
```json wrap icon="code" Example config with Azure AI provider
111113
{
112114
"$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
113115
"models": [
114116
{
115117
"provider": "azure",
116-
"model": "YOUR_MODEL_HERE",
118+
"model": "YOUR_DEPLOYMENT_NAME",
117119
"displayName": "OPTIONAL_DISPLAY_NAME",
118120
"resourceName": "YOUR_RESOURCE_NAME", // defaults to the AZURE_RESOURCE_NAME env var if not set
119-
"apiVersion": "OPTIONAL_API_VERSION", // defaults to 'preview' if not set
121+
"apiVersion": "OPTIONAL_API_VERSION",
120122
"token": {
121123
"env": "AZURE_API_KEY"
122124
},
123-
"baseUrl": "OPTIONAL_BASE_URL"
125+
"baseUrl": "OPTIONAL_BASE_URL", // use instead of resourceName for custom endpoints
126+
"reasoningEffort": "OPTIONAL_REASONING_EFFORT" // defaults to "medium"
124127
}
125128
]
126129
}

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)