@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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.0-canary.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [d1a1aa1]
8
+ - @ai-sdk/provider@2.0.0-canary.3
9
+ - @ai-sdk/provider-utils@3.0.0-canary.4
10
+
3
11
  ## 2.0.0-canary.3
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -631,9 +631,12 @@ var OpenAIChatLanguageModel = class {
631
631
  completionTokens: (_h = (_g = response.usage) == null ? void 0 : _g.completion_tokens) != null ? _h : NaN
632
632
  },
633
633
  rawCall: { rawPrompt, rawSettings },
634
- rawResponse: { headers: responseHeaders, body: rawResponse },
635
634
  request: { body: JSON.stringify(body) },
636
- response: getResponseMetadata(response),
635
+ response: {
636
+ ...getResponseMetadata(response),
637
+ headers: responseHeaders,
638
+ body: rawResponse
639
+ },
637
640
  warnings,
638
641
  logprobs: mapOpenAIChatLogProbsOutput(choice.logprobs),
639
642
  providerMetadata
@@ -679,7 +682,7 @@ var OpenAIChatLanguageModel = class {
679
682
  return {
680
683
  stream: simulatedStream,
681
684
  rawCall: result.rawCall,
682
- rawResponse: result.rawResponse,
685
+ response: result.response,
683
686
  warnings: result.warnings
684
687
  };
685
688
  }
@@ -889,7 +892,7 @@ var OpenAIChatLanguageModel = class {
889
892
  })
890
893
  ),
891
894
  rawCall: { rawPrompt, rawSettings },
892
- rawResponse: { headers: responseHeaders },
895
+ response: { headers: responseHeaders },
893
896
  request: { body: JSON.stringify(body) },
894
897
  warnings
895
898
  };
@@ -1232,10 +1235,13 @@ var OpenAICompletionLanguageModel = class {
1232
1235
  finishReason: mapOpenAIFinishReason(choice.finish_reason),
1233
1236
  logprobs: mapOpenAICompletionLogProbs(choice.logprobs),
1234
1237
  rawCall: { rawPrompt, rawSettings },
1235
- rawResponse: { headers: responseHeaders, body: rawResponse },
1236
- response: getResponseMetadata(response),
1237
- warnings,
1238
- request: { body: JSON.stringify(args) }
1238
+ request: { body: JSON.stringify(args) },
1239
+ response: {
1240
+ ...getResponseMetadata(response),
1241
+ headers: responseHeaders,
1242
+ body: rawResponse
1243
+ },
1244
+ warnings
1239
1245
  };
1240
1246
  }
1241
1247
  async doStream(options) {
@@ -1325,7 +1331,7 @@ var OpenAICompletionLanguageModel = class {
1325
1331
  })
1326
1332
  ),
1327
1333
  rawCall: { rawPrompt, rawSettings },
1328
- rawResponse: { headers: responseHeaders },
1334
+ response: { headers: responseHeaders },
1329
1335
  warnings,
1330
1336
  request: { body: JSON.stringify(body) }
1331
1337
  };
@@ -2156,17 +2162,15 @@ var OpenAIResponsesLanguageModel = class {
2156
2162
  rawPrompt: void 0,
2157
2163
  rawSettings: {}
2158
2164
  },
2159
- rawResponse: {
2160
- headers: responseHeaders,
2161
- body: rawResponse
2162
- },
2163
2165
  request: {
2164
2166
  body: JSON.stringify(body)
2165
2167
  },
2166
2168
  response: {
2167
2169
  id: response.id,
2168
2170
  timestamp: new Date(response.created_at * 1e3),
2169
- modelId: response.model
2171
+ modelId: response.model,
2172
+ headers: responseHeaders,
2173
+ body: rawResponse
2170
2174
  },
2171
2175
  providerMetadata: {
2172
2176
  openai: {
@@ -2308,8 +2312,8 @@ var OpenAIResponsesLanguageModel = class {
2308
2312
  rawPrompt: void 0,
2309
2313
  rawSettings: {}
2310
2314
  },
2311
- rawResponse: { headers: responseHeaders },
2312
2315
  request: { body: JSON.stringify(body) },
2316
+ response: { headers: responseHeaders },
2313
2317
  warnings
2314
2318
  };
2315
2319
  }