Skip to content

Commit d488c38

Browse files
Add reasoning effort option
1 parent 26c553c commit d488c38

File tree

8 files changed

+99
-1
lines changed

8 files changed

+99
-1
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,16 @@
18181818
"format": "url",
18191819
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
18201820
"description": "Optional base URL."
1821+
},
1822+
"reasoningEffort": {
1823+
"type": "string",
1824+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
1825+
"examples": [
1826+
"minimal",
1827+
"low",
1828+
"medium",
1829+
"high"
1830+
]
18211831
}
18221832
},
18231833
"required": [
@@ -2624,6 +2634,16 @@
26242634
"format": "url",
26252635
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
26262636
"description": "Optional base URL."
2637+
},
2638+
"reasoningEffort": {
2639+
"type": "string",
2640+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
2641+
"examples": [
2642+
"minimal",
2643+
"low",
2644+
"medium",
2645+
"high"
2646+
]
26272647
}
26282648
},
26292649
"required": [

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,16 @@
615615
"format": "url",
616616
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
617617
"description": "Optional base URL."
618+
},
619+
"reasoningEffort": {
620+
"type": "string",
621+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
622+
"examples": [
623+
"minimal",
624+
"low",
625+
"medium",
626+
"high"
627+
]
618628
}
619629
},
620630
"required": [
@@ -1421,6 +1431,16 @@
14211431
"format": "url",
14221432
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
14231433
"description": "Optional base URL."
1434+
},
1435+
"reasoningEffort": {
1436+
"type": "string",
1437+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
1438+
"examples": [
1439+
"minimal",
1440+
"low",
1441+
"medium",
1442+
"high"
1443+
]
14241444
}
14251445
},
14261446
"required": [

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,6 +1817,16 @@ const schema = {
18171817
"format": "url",
18181818
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
18191819
"description": "Optional base URL."
1820+
},
1821+
"reasoningEffort": {
1822+
"type": "string",
1823+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
1824+
"examples": [
1825+
"minimal",
1826+
"low",
1827+
"medium",
1828+
"high"
1829+
]
18201830
}
18211831
},
18221832
"required": [
@@ -2623,6 +2633,16 @@ const schema = {
26232633
"format": "url",
26242634
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
26252635
"description": "Optional base URL."
2636+
},
2637+
"reasoningEffort": {
2638+
"type": "string",
2639+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
2640+
"examples": [
2641+
"minimal",
2642+
"low",
2643+
"medium",
2644+
"high"
2645+
]
26262646
}
26272647
},
26282648
"required": [

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,10 @@ export interface OpenAILanguageModel {
792792
* Optional base URL.
793793
*/
794794
baseUrl?: string;
795+
/**
796+
* The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings
797+
*/
798+
reasoningEffort?: string;
795799
}
796800
export interface OpenAICompatibleLanguageModel {
797801
/**

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,16 @@ const schema = {
614614
"format": "url",
615615
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
616616
"description": "Optional base URL."
617+
},
618+
"reasoningEffort": {
619+
"type": "string",
620+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
621+
"examples": [
622+
"minimal",
623+
"low",
624+
"medium",
625+
"high"
626+
]
617627
}
618628
},
619629
"required": [
@@ -1420,6 +1430,16 @@ const schema = {
14201430
"format": "url",
14211431
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
14221432
"description": "Optional base URL."
1433+
},
1434+
"reasoningEffort": {
1435+
"type": "string",
1436+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
1437+
"examples": [
1438+
"minimal",
1439+
"low",
1440+
"medium",
1441+
"high"
1442+
]
14231443
}
14241444
},
14251445
"required": [

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ export interface OpenAILanguageModel {
363363
* Optional base URL.
364364
*/
365365
baseUrl?: string;
366+
/**
367+
* The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings
368+
*/
369+
reasoningEffort?: string;
366370
}
367371
export interface OpenAICompatibleLanguageModel {
368372
/**

packages/web/src/app/api/(server)/chat/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ const getAISDKLanguageModelAndOptions = async (config: LanguageModel, orgId: num
440440
model: openai(modelId),
441441
providerOptions: {
442442
openai: {
443-
reasoningEffort: 'high'
443+
reasoningEffort: config.reasoningEffort ?? 'medium'
444444
} satisfies OpenAIResponsesProviderOptions,
445445
},
446446
};

schemas/v3/languageModel.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,16 @@
343343
"format": "url",
344344
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
345345
"description": "Optional base URL."
346+
},
347+
"reasoningEffort": {
348+
"type": "string",
349+
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
350+
"examples": [
351+
"minimal",
352+
"low",
353+
"medium",
354+
"high"
355+
]
346356
}
347357
},
348358
"required": [

0 commit comments

Comments
 (0)