@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
|
@@ -8,7 +8,7 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
8
8
|
logprobs?: number | boolean | undefined;
|
|
9
9
|
parallelToolCalls?: boolean | undefined;
|
|
10
10
|
user?: string | undefined;
|
|
11
|
-
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
11
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
12
12
|
maxCompletionTokens?: number | undefined;
|
|
13
13
|
store?: boolean | undefined;
|
|
14
14
|
metadata?: Record<string, string> | undefined;
|
|
@@ -17,6 +17,10 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
17
17
|
strictJsonSchema?: boolean | undefined;
|
|
18
18
|
textVerbosity?: "low" | "medium" | "high" | undefined;
|
|
19
19
|
promptCacheKey?: string | undefined;
|
|
20
|
+
promptCacheOptions?: {
|
|
21
|
+
mode?: "explicit" | "implicit" | undefined;
|
|
22
|
+
ttl?: "30m" | undefined;
|
|
23
|
+
} | undefined;
|
|
20
24
|
promptCacheRetention?: "in_memory" | "24h" | undefined;
|
|
21
25
|
safetyIdentifier?: string | undefined;
|
|
22
26
|
systemMessageMode?: "remove" | "system" | "developer" | undefined;
|
|
@@ -297,6 +301,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
297
301
|
output_tokens: number;
|
|
298
302
|
input_tokens_details?: {
|
|
299
303
|
cached_tokens?: number | null | undefined;
|
|
304
|
+
cache_write_tokens?: number | null | undefined;
|
|
300
305
|
orchestration_input_tokens?: number | null | undefined;
|
|
301
306
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
302
307
|
} | null | undefined;
|
|
@@ -308,6 +313,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
308
313
|
incomplete_details?: {
|
|
309
314
|
reason: string;
|
|
310
315
|
} | null | undefined;
|
|
316
|
+
reasoning?: {
|
|
317
|
+
context?: string | null | undefined;
|
|
318
|
+
} | null | undefined;
|
|
311
319
|
service_tier?: string | null | undefined;
|
|
312
320
|
};
|
|
313
321
|
} | {
|
|
@@ -326,6 +334,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
326
334
|
output_tokens: number;
|
|
327
335
|
input_tokens_details?: {
|
|
328
336
|
cached_tokens?: number | null | undefined;
|
|
337
|
+
cache_write_tokens?: number | null | undefined;
|
|
329
338
|
orchestration_input_tokens?: number | null | undefined;
|
|
330
339
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
331
340
|
} | null | undefined;
|
|
@@ -334,6 +343,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
334
343
|
orchestration_output_tokens?: number | null | undefined;
|
|
335
344
|
} | null | undefined;
|
|
336
345
|
} | null | undefined;
|
|
346
|
+
reasoning?: {
|
|
347
|
+
context?: string | null | undefined;
|
|
348
|
+
} | null | undefined;
|
|
337
349
|
service_tier?: string | null | undefined;
|
|
338
350
|
};
|
|
339
351
|
} | {
|
|
@@ -734,6 +746,7 @@ type ResponsesProviderMetadata = {
|
|
|
734
746
|
responseId: string | null | undefined;
|
|
735
747
|
logprobs?: Array<OpenAIResponsesLogprobs>;
|
|
736
748
|
serviceTier?: string;
|
|
749
|
+
reasoningContext?: string;
|
|
737
750
|
};
|
|
738
751
|
type ResponsesReasoningProviderMetadata = {
|
|
739
752
|
itemId: string;
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
8
8
|
logprobs?: number | boolean | undefined;
|
|
9
9
|
parallelToolCalls?: boolean | undefined;
|
|
10
10
|
user?: string | undefined;
|
|
11
|
-
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
11
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
12
12
|
maxCompletionTokens?: number | undefined;
|
|
13
13
|
store?: boolean | undefined;
|
|
14
14
|
metadata?: Record<string, string> | undefined;
|
|
@@ -17,6 +17,10 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
17
17
|
strictJsonSchema?: boolean | undefined;
|
|
18
18
|
textVerbosity?: "low" | "medium" | "high" | undefined;
|
|
19
19
|
promptCacheKey?: string | undefined;
|
|
20
|
+
promptCacheOptions?: {
|
|
21
|
+
mode?: "explicit" | "implicit" | undefined;
|
|
22
|
+
ttl?: "30m" | undefined;
|
|
23
|
+
} | undefined;
|
|
20
24
|
promptCacheRetention?: "in_memory" | "24h" | undefined;
|
|
21
25
|
safetyIdentifier?: string | undefined;
|
|
22
26
|
systemMessageMode?: "remove" | "system" | "developer" | undefined;
|
|
@@ -297,6 +301,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
297
301
|
output_tokens: number;
|
|
298
302
|
input_tokens_details?: {
|
|
299
303
|
cached_tokens?: number | null | undefined;
|
|
304
|
+
cache_write_tokens?: number | null | undefined;
|
|
300
305
|
orchestration_input_tokens?: number | null | undefined;
|
|
301
306
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
302
307
|
} | null | undefined;
|
|
@@ -308,6 +313,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
308
313
|
incomplete_details?: {
|
|
309
314
|
reason: string;
|
|
310
315
|
} | null | undefined;
|
|
316
|
+
reasoning?: {
|
|
317
|
+
context?: string | null | undefined;
|
|
318
|
+
} | null | undefined;
|
|
311
319
|
service_tier?: string | null | undefined;
|
|
312
320
|
};
|
|
313
321
|
} | {
|
|
@@ -326,6 +334,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
326
334
|
output_tokens: number;
|
|
327
335
|
input_tokens_details?: {
|
|
328
336
|
cached_tokens?: number | null | undefined;
|
|
337
|
+
cache_write_tokens?: number | null | undefined;
|
|
329
338
|
orchestration_input_tokens?: number | null | undefined;
|
|
330
339
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
331
340
|
} | null | undefined;
|
|
@@ -334,6 +343,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
334
343
|
orchestration_output_tokens?: number | null | undefined;
|
|
335
344
|
} | null | undefined;
|
|
336
345
|
} | null | undefined;
|
|
346
|
+
reasoning?: {
|
|
347
|
+
context?: string | null | undefined;
|
|
348
|
+
} | null | undefined;
|
|
337
349
|
service_tier?: string | null | undefined;
|
|
338
350
|
};
|
|
339
351
|
} | {
|
|
@@ -734,6 +746,7 @@ type ResponsesProviderMetadata = {
|
|
|
734
746
|
responseId: string | null | undefined;
|
|
735
747
|
logprobs?: Array<OpenAIResponsesLogprobs>;
|
|
736
748
|
serviceTier?: string;
|
|
749
|
+
reasoningContext?: string;
|
|
737
750
|
};
|
|
738
751
|
type ResponsesReasoningProviderMetadata = {
|
|
739
752
|
itemId: string;
|