@ai-sdk/openai 2.1.0-beta.4 → 2.1.0-beta.6

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.1.0-beta.6
4
+
5
+ ### Patch Changes
6
+
7
+ - fe49278: feat(provider/openai): only send item references for reasoning when store: true
8
+
9
+ ## 2.1.0-beta.5
10
+
11
+ ### Patch Changes
12
+
13
+ - 4616b86: chore: update zod peer depenedency version
14
+ - Updated dependencies [4616b86]
15
+ - @ai-sdk/provider-utils@3.1.0-beta.4
16
+
3
17
  ## 2.1.0-beta.4
4
18
 
5
19
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2088,26 +2088,40 @@ async function convertToOpenAIResponsesInput({
2088
2088
  });
2089
2089
  const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
2090
2090
  if (reasoningId != null) {
2091
- const existingReasoningMessage = reasoningMessages[reasoningId];
2092
- const summaryParts = [];
2093
- if (part.text.length > 0) {
2094
- summaryParts.push({ type: "summary_text", text: part.text });
2095
- } else if (existingReasoningMessage !== void 0) {
2096
- warnings.push({
2097
- type: "other",
2098
- message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
2099
- });
2100
- }
2101
- if (existingReasoningMessage === void 0) {
2102
- reasoningMessages[reasoningId] = {
2103
- type: "reasoning",
2104
- id: reasoningId,
2105
- encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
2106
- summary: summaryParts
2107
- };
2108
- input.push(reasoningMessages[reasoningId]);
2091
+ const reasoningMessage = reasoningMessages[reasoningId];
2092
+ if (store) {
2093
+ if (reasoningMessage === void 0) {
2094
+ input.push({ type: "item_reference", id: reasoningId });
2095
+ reasoningMessages[reasoningId] = {
2096
+ type: "reasoning",
2097
+ id: reasoningId,
2098
+ summary: []
2099
+ };
2100
+ }
2109
2101
  } else {
2110
- existingReasoningMessage.summary.push(...summaryParts);
2102
+ const summaryParts = [];
2103
+ if (part.text.length > 0) {
2104
+ summaryParts.push({
2105
+ type: "summary_text",
2106
+ text: part.text
2107
+ });
2108
+ } else if (reasoningMessage !== void 0) {
2109
+ warnings.push({
2110
+ type: "other",
2111
+ message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
2112
+ });
2113
+ }
2114
+ if (reasoningMessage === void 0) {
2115
+ reasoningMessages[reasoningId] = {
2116
+ type: "reasoning",
2117
+ id: reasoningId,
2118
+ encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
2119
+ summary: summaryParts
2120
+ };
2121
+ input.push(reasoningMessages[reasoningId]);
2122
+ } else {
2123
+ reasoningMessage.summary.push(...summaryParts);
2124
+ }
2111
2125
  }
2112
2126
  } else {
2113
2127
  warnings.push({
@@ -3870,7 +3884,7 @@ var openaiTranscriptionResponseSchema = import_v418.z.object({
3870
3884
  });
3871
3885
 
3872
3886
  // src/version.ts
3873
- var VERSION = true ? "2.1.0-beta.4" : "0.0.0-test";
3887
+ var VERSION = true ? "2.1.0-beta.6" : "0.0.0-test";
3874
3888
 
3875
3889
  // src/openai-provider.ts
3876
3890
  function createOpenAI(options = {}) {