@ai-sdk/openai 4.0.89 → 4.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +4 -2
- package/dist/internal/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat/openai-chat-language-model.ts +1 -1
- package/src/openai-language-model-capabilities.ts +7 -5
- package/src/responses/openai-responses-language-model.ts +10 -2
package/package.json
CHANGED
|
@@ -259,7 +259,7 @@ export class OpenAIChatLanguageModel implements LanguageModelV4 {
|
|
|
259
259
|
// remove unsupported settings for reasoning models
|
|
260
260
|
// see https://platform.openai.com/docs/guides/reasoning#limitations
|
|
261
261
|
if (isReasoningModel) {
|
|
262
|
-
//
|
|
262
|
+
// supported models allow temperature, topP, and logprobs when reasoning effort is none
|
|
263
263
|
// https://platform.openai.com/docs/guides/latest-model#gpt-5-1-parameter-compatibility
|
|
264
264
|
if (
|
|
265
265
|
resolvedReasoningEffort !== 'none' ||
|
|
@@ -45,12 +45,14 @@ export function getOpenAILanguageModelCapabilities(
|
|
|
45
45
|
(gptVersion != null && gptVersion.major >= 5 && !isGptChatModel);
|
|
46
46
|
|
|
47
47
|
// https://platform.openai.com/docs/guides/latest-model#gpt-5-1-parameter-compatibility
|
|
48
|
-
// GPT-5.1 and
|
|
48
|
+
// GPT-5.1 through GPT-5.x and GPT-6 Sol/Luna support temperature,
|
|
49
|
+
// topP, and logProbs when reasoningEffort is none.
|
|
49
50
|
const supportsNonReasoningParameters =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
(gptVersion.major
|
|
51
|
+
isGpt6SolOrLuna ||
|
|
52
|
+
(!isGpt6OrLaterModel &&
|
|
53
|
+
gptVersion != null &&
|
|
54
|
+
(gptVersion.major > 5 ||
|
|
55
|
+
(gptVersion.major === 5 && (gptVersion.minor ?? 0) >= 1)));
|
|
54
56
|
|
|
55
57
|
const systemMessageMode = isReasoningModel ? 'developer' : 'system';
|
|
56
58
|
|
|
@@ -685,11 +685,19 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV4 {
|
|
|
685
685
|
// remove unsupported settings for reasoning models
|
|
686
686
|
// see https://platform.openai.com/docs/guides/reasoning#limitations
|
|
687
687
|
if (isReasoningModel) {
|
|
688
|
-
//
|
|
688
|
+
// Input updates change the effort used to validate sampling parameters.
|
|
689
|
+
let effectiveReasoningEffort = resolvedReasoningEffort;
|
|
690
|
+
for (const item of input) {
|
|
691
|
+
if (item.type === 'configuration_update') {
|
|
692
|
+
effectiveReasoningEffort = item.reasoning.effort;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
// supported models allow temperature, topP, and logprobs when reasoning effort is none
|
|
689
697
|
// https://platform.openai.com/docs/guides/latest-model#gpt-5-1-parameter-compatibility
|
|
690
698
|
if (
|
|
691
699
|
!(
|
|
692
|
-
|
|
700
|
+
effectiveReasoningEffort === 'none' &&
|
|
693
701
|
modelCapabilities.supportsNonReasoningParameters
|
|
694
702
|
)
|
|
695
703
|
) {
|