@ai-sdk/openai 2.0.36 → 2.0.37

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