@ai-sdk/openai 2.1.0-beta.5 → 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/dist/index.mjs CHANGED
@@ -2109,26 +2109,40 @@ async function convertToOpenAIResponsesInput({
2109
2109
  });
2110
2110
  const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
2111
2111
  if (reasoningId != null) {
2112
- const existingReasoningMessage = reasoningMessages[reasoningId];
2113
- const summaryParts = [];
2114
- if (part.text.length > 0) {
2115
- summaryParts.push({ type: "summary_text", text: part.text });
2116
- } else if (existingReasoningMessage !== void 0) {
2117
- warnings.push({
2118
- type: "other",
2119
- message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
2120
- });
2121
- }
2122
- if (existingReasoningMessage === void 0) {
2123
- reasoningMessages[reasoningId] = {
2124
- type: "reasoning",
2125
- id: reasoningId,
2126
- encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
2127
- summary: summaryParts
2128
- };
2129
- input.push(reasoningMessages[reasoningId]);
2112
+ const reasoningMessage = reasoningMessages[reasoningId];
2113
+ if (store) {
2114
+ if (reasoningMessage === void 0) {
2115
+ input.push({ type: "item_reference", id: reasoningId });
2116
+ reasoningMessages[reasoningId] = {
2117
+ type: "reasoning",
2118
+ id: reasoningId,
2119
+ summary: []
2120
+ };
2121
+ }
2130
2122
  } else {
2131
- existingReasoningMessage.summary.push(...summaryParts);
2123
+ const summaryParts = [];
2124
+ if (part.text.length > 0) {
2125
+ summaryParts.push({
2126
+ type: "summary_text",
2127
+ text: part.text
2128
+ });
2129
+ } else if (reasoningMessage !== void 0) {
2130
+ warnings.push({
2131
+ type: "other",
2132
+ message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
2133
+ });
2134
+ }
2135
+ if (reasoningMessage === void 0) {
2136
+ reasoningMessages[reasoningId] = {
2137
+ type: "reasoning",
2138
+ id: reasoningId,
2139
+ encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
2140
+ summary: summaryParts
2141
+ };
2142
+ input.push(reasoningMessages[reasoningId]);
2143
+ } else {
2144
+ reasoningMessage.summary.push(...summaryParts);
2145
+ }
2132
2146
  }
2133
2147
  } else {
2134
2148
  warnings.push({
@@ -3905,7 +3919,7 @@ var openaiTranscriptionResponseSchema = z18.object({
3905
3919
  });
3906
3920
 
3907
3921
  // src/version.ts
3908
- var VERSION = true ? "2.1.0-beta.5" : "0.0.0-test";
3922
+ var VERSION = true ? "2.1.0-beta.6" : "0.0.0-test";
3909
3923
 
3910
3924
  // src/openai-provider.ts
3911
3925
  function createOpenAI(options = {}) {