@ai-sdk/openai 2.0.0-canary.3 → 2.0.0-canary.4

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
@@ -621,9 +621,12 @@ var OpenAIChatLanguageModel = class {
621
621
  completionTokens: (_h = (_g = response.usage) == null ? void 0 : _g.completion_tokens) != null ? _h : NaN
622
622
  },
623
623
  rawCall: { rawPrompt, rawSettings },
624
- rawResponse: { headers: responseHeaders, body: rawResponse },
625
624
  request: { body: JSON.stringify(body) },
626
- response: getResponseMetadata(response),
625
+ response: {
626
+ ...getResponseMetadata(response),
627
+ headers: responseHeaders,
628
+ body: rawResponse
629
+ },
627
630
  warnings,
628
631
  logprobs: mapOpenAIChatLogProbsOutput(choice.logprobs),
629
632
  providerMetadata
@@ -669,7 +672,7 @@ var OpenAIChatLanguageModel = class {
669
672
  return {
670
673
  stream: simulatedStream,
671
674
  rawCall: result.rawCall,
672
- rawResponse: result.rawResponse,
675
+ response: result.response,
673
676
  warnings: result.warnings
674
677
  };
675
678
  }
@@ -879,7 +882,7 @@ var OpenAIChatLanguageModel = class {
879
882
  })
880
883
  ),
881
884
  rawCall: { rawPrompt, rawSettings },
882
- rawResponse: { headers: responseHeaders },
885
+ response: { headers: responseHeaders },
883
886
  request: { body: JSON.stringify(body) },
884
887
  warnings
885
888
  };
@@ -1230,10 +1233,13 @@ var OpenAICompletionLanguageModel = class {
1230
1233
  finishReason: mapOpenAIFinishReason(choice.finish_reason),
1231
1234
  logprobs: mapOpenAICompletionLogProbs(choice.logprobs),
1232
1235
  rawCall: { rawPrompt, rawSettings },
1233
- rawResponse: { headers: responseHeaders, body: rawResponse },
1234
- response: getResponseMetadata(response),
1235
- warnings,
1236
- request: { body: JSON.stringify(args) }
1236
+ request: { body: JSON.stringify(args) },
1237
+ response: {
1238
+ ...getResponseMetadata(response),
1239
+ headers: responseHeaders,
1240
+ body: rawResponse
1241
+ },
1242
+ warnings
1237
1243
  };
1238
1244
  }
1239
1245
  async doStream(options) {
@@ -1323,7 +1329,7 @@ var OpenAICompletionLanguageModel = class {
1323
1329
  })
1324
1330
  ),
1325
1331
  rawCall: { rawPrompt, rawSettings },
1326
- rawResponse: { headers: responseHeaders },
1332
+ response: { headers: responseHeaders },
1327
1333
  warnings,
1328
1334
  request: { body: JSON.stringify(body) }
1329
1335
  };
@@ -2181,17 +2187,15 @@ var OpenAIResponsesLanguageModel = class {
2181
2187
  rawPrompt: void 0,
2182
2188
  rawSettings: {}
2183
2189
  },
2184
- rawResponse: {
2185
- headers: responseHeaders,
2186
- body: rawResponse
2187
- },
2188
2190
  request: {
2189
2191
  body: JSON.stringify(body)
2190
2192
  },
2191
2193
  response: {
2192
2194
  id: response.id,
2193
2195
  timestamp: new Date(response.created_at * 1e3),
2194
- modelId: response.model
2196
+ modelId: response.model,
2197
+ headers: responseHeaders,
2198
+ body: rawResponse
2195
2199
  },
2196
2200
  providerMetadata: {
2197
2201
  openai: {
@@ -2333,8 +2337,8 @@ var OpenAIResponsesLanguageModel = class {
2333
2337
  rawPrompt: void 0,
2334
2338
  rawSettings: {}
2335
2339
  },
2336
- rawResponse: { headers: responseHeaders },
2337
2340
  request: { body: JSON.stringify(body) },
2341
+ response: { headers: responseHeaders },
2338
2342
  warnings
2339
2343
  };
2340
2344
  }