@ai-sdk/openai 3.0.83 → 3.0.85
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 +13 -0
- package/dist/index.d.mts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +307 -66
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +307 -66
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +14 -1
- package/dist/internal/index.d.ts +14 -1
- package/dist/internal/index.js +306 -65
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +306 -65
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +81 -31
- package/package.json +2 -2
- package/src/chat/convert-openai-chat-usage.ts +5 -2
- package/src/chat/convert-to-openai-chat-messages.ts +111 -7
- package/src/chat/openai-chat-api.ts +2 -0
- package/src/chat/openai-chat-language-model.ts +1 -0
- package/src/chat/openai-chat-options.ts +16 -2
- package/src/chat/openai-chat-prompt.ts +8 -4
- package/src/responses/convert-openai-responses-usage.ts +5 -2
- package/src/responses/convert-to-openai-responses-input.ts +117 -6
- package/src/responses/openai-responses-api.ts +77 -11
- package/src/responses/openai-responses-language-model.ts +37 -1
- package/src/responses/openai-responses-options.ts +32 -7
- package/src/responses/openai-responses-provider-metadata.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.85
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [06fb54c]
|
|
8
|
+
- @ai-sdk/provider-utils@4.0.39
|
|
9
|
+
|
|
10
|
+
## 3.0.84
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 356918c: feat(provider/openai): add GPT-5.6 reasoning and prompt cache controls
|
|
15
|
+
|
|
3
16
|
## 3.0.83
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
9
9
|
logprobs?: number | boolean | undefined;
|
|
10
10
|
parallelToolCalls?: boolean | undefined;
|
|
11
11
|
user?: string | undefined;
|
|
12
|
-
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
12
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
13
13
|
maxCompletionTokens?: number | undefined;
|
|
14
14
|
store?: boolean | undefined;
|
|
15
15
|
metadata?: Record<string, string> | undefined;
|
|
@@ -18,6 +18,10 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
18
18
|
strictJsonSchema?: boolean | undefined;
|
|
19
19
|
textVerbosity?: "low" | "medium" | "high" | undefined;
|
|
20
20
|
promptCacheKey?: string | undefined;
|
|
21
|
+
promptCacheOptions?: {
|
|
22
|
+
mode?: "explicit" | "implicit" | undefined;
|
|
23
|
+
ttl?: "30m" | undefined;
|
|
24
|
+
} | undefined;
|
|
21
25
|
promptCacheRetention?: "in_memory" | "24h" | undefined;
|
|
22
26
|
safetyIdentifier?: string | undefined;
|
|
23
27
|
systemMessageMode?: "remove" | "system" | "developer" | undefined;
|
|
@@ -244,6 +248,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
244
248
|
output_tokens: number;
|
|
245
249
|
input_tokens_details?: {
|
|
246
250
|
cached_tokens?: number | null | undefined;
|
|
251
|
+
cache_write_tokens?: number | null | undefined;
|
|
247
252
|
orchestration_input_tokens?: number | null | undefined;
|
|
248
253
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
249
254
|
} | null | undefined;
|
|
@@ -255,6 +260,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
255
260
|
incomplete_details?: {
|
|
256
261
|
reason: string;
|
|
257
262
|
} | null | undefined;
|
|
263
|
+
reasoning?: {
|
|
264
|
+
context?: string | null | undefined;
|
|
265
|
+
} | null | undefined;
|
|
258
266
|
service_tier?: string | null | undefined;
|
|
259
267
|
};
|
|
260
268
|
} | {
|
|
@@ -273,6 +281,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
273
281
|
output_tokens: number;
|
|
274
282
|
input_tokens_details?: {
|
|
275
283
|
cached_tokens?: number | null | undefined;
|
|
284
|
+
cache_write_tokens?: number | null | undefined;
|
|
276
285
|
orchestration_input_tokens?: number | null | undefined;
|
|
277
286
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
278
287
|
} | null | undefined;
|
|
@@ -281,6 +290,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
281
290
|
orchestration_output_tokens?: number | null | undefined;
|
|
282
291
|
} | null | undefined;
|
|
283
292
|
} | null | undefined;
|
|
293
|
+
reasoning?: {
|
|
294
|
+
context?: string | null | undefined;
|
|
295
|
+
} | null | undefined;
|
|
284
296
|
service_tier?: string | null | undefined;
|
|
285
297
|
};
|
|
286
298
|
} | {
|
|
@@ -1067,8 +1079,14 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
|
|
|
1067
1079
|
parallelToolCalls?: boolean | null | undefined;
|
|
1068
1080
|
previousResponseId?: string | null | undefined;
|
|
1069
1081
|
promptCacheKey?: string | null | undefined;
|
|
1082
|
+
promptCacheOptions?: {
|
|
1083
|
+
mode?: "explicit" | "implicit" | undefined;
|
|
1084
|
+
ttl?: "30m" | undefined;
|
|
1085
|
+
} | undefined;
|
|
1070
1086
|
promptCacheRetention?: "in_memory" | "24h" | null | undefined;
|
|
1071
1087
|
reasoningEffort?: string | null | undefined;
|
|
1088
|
+
reasoningMode?: "standard" | "pro" | undefined;
|
|
1089
|
+
reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
|
|
1072
1090
|
reasoningSummary?: string | null | undefined;
|
|
1073
1091
|
safetyIdentifier?: string | null | undefined;
|
|
1074
1092
|
serviceTier?: "default" | "auto" | "flex" | "priority" | null | undefined;
|
|
@@ -1207,6 +1225,7 @@ type ResponsesProviderMetadata = {
|
|
|
1207
1225
|
responseId: string | null | undefined;
|
|
1208
1226
|
logprobs?: Array<OpenAIResponsesLogprobs>;
|
|
1209
1227
|
serviceTier?: string;
|
|
1228
|
+
reasoningContext?: string;
|
|
1210
1229
|
};
|
|
1211
1230
|
type ResponsesReasoningProviderMetadata = {
|
|
1212
1231
|
itemId: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
9
9
|
logprobs?: number | boolean | undefined;
|
|
10
10
|
parallelToolCalls?: boolean | undefined;
|
|
11
11
|
user?: string | undefined;
|
|
12
|
-
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
12
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
13
13
|
maxCompletionTokens?: number | undefined;
|
|
14
14
|
store?: boolean | undefined;
|
|
15
15
|
metadata?: Record<string, string> | undefined;
|
|
@@ -18,6 +18,10 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
18
18
|
strictJsonSchema?: boolean | undefined;
|
|
19
19
|
textVerbosity?: "low" | "medium" | "high" | undefined;
|
|
20
20
|
promptCacheKey?: string | undefined;
|
|
21
|
+
promptCacheOptions?: {
|
|
22
|
+
mode?: "explicit" | "implicit" | undefined;
|
|
23
|
+
ttl?: "30m" | undefined;
|
|
24
|
+
} | undefined;
|
|
21
25
|
promptCacheRetention?: "in_memory" | "24h" | undefined;
|
|
22
26
|
safetyIdentifier?: string | undefined;
|
|
23
27
|
systemMessageMode?: "remove" | "system" | "developer" | undefined;
|
|
@@ -244,6 +248,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
244
248
|
output_tokens: number;
|
|
245
249
|
input_tokens_details?: {
|
|
246
250
|
cached_tokens?: number | null | undefined;
|
|
251
|
+
cache_write_tokens?: number | null | undefined;
|
|
247
252
|
orchestration_input_tokens?: number | null | undefined;
|
|
248
253
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
249
254
|
} | null | undefined;
|
|
@@ -255,6 +260,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
255
260
|
incomplete_details?: {
|
|
256
261
|
reason: string;
|
|
257
262
|
} | null | undefined;
|
|
263
|
+
reasoning?: {
|
|
264
|
+
context?: string | null | undefined;
|
|
265
|
+
} | null | undefined;
|
|
258
266
|
service_tier?: string | null | undefined;
|
|
259
267
|
};
|
|
260
268
|
} | {
|
|
@@ -273,6 +281,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
273
281
|
output_tokens: number;
|
|
274
282
|
input_tokens_details?: {
|
|
275
283
|
cached_tokens?: number | null | undefined;
|
|
284
|
+
cache_write_tokens?: number | null | undefined;
|
|
276
285
|
orchestration_input_tokens?: number | null | undefined;
|
|
277
286
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
278
287
|
} | null | undefined;
|
|
@@ -281,6 +290,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
281
290
|
orchestration_output_tokens?: number | null | undefined;
|
|
282
291
|
} | null | undefined;
|
|
283
292
|
} | null | undefined;
|
|
293
|
+
reasoning?: {
|
|
294
|
+
context?: string | null | undefined;
|
|
295
|
+
} | null | undefined;
|
|
284
296
|
service_tier?: string | null | undefined;
|
|
285
297
|
};
|
|
286
298
|
} | {
|
|
@@ -1067,8 +1079,14 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
|
|
|
1067
1079
|
parallelToolCalls?: boolean | null | undefined;
|
|
1068
1080
|
previousResponseId?: string | null | undefined;
|
|
1069
1081
|
promptCacheKey?: string | null | undefined;
|
|
1082
|
+
promptCacheOptions?: {
|
|
1083
|
+
mode?: "explicit" | "implicit" | undefined;
|
|
1084
|
+
ttl?: "30m" | undefined;
|
|
1085
|
+
} | undefined;
|
|
1070
1086
|
promptCacheRetention?: "in_memory" | "24h" | null | undefined;
|
|
1071
1087
|
reasoningEffort?: string | null | undefined;
|
|
1088
|
+
reasoningMode?: "standard" | "pro" | undefined;
|
|
1089
|
+
reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
|
|
1072
1090
|
reasoningSummary?: string | null | undefined;
|
|
1073
1091
|
safetyIdentifier?: string | null | undefined;
|
|
1074
1092
|
serviceTier?: "default" | "auto" | "flex" | "priority" | null | undefined;
|
|
@@ -1207,6 +1225,7 @@ type ResponsesProviderMetadata = {
|
|
|
1207
1225
|
responseId: string | null | undefined;
|
|
1208
1226
|
logprobs?: Array<OpenAIResponsesLogprobs>;
|
|
1209
1227
|
serviceTier?: string;
|
|
1228
|
+
reasoningContext?: string;
|
|
1210
1229
|
};
|
|
1211
1230
|
type ResponsesReasoningProviderMetadata = {
|
|
1212
1231
|
itemId: string;
|