@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 +8 -0
- package/dist/index.js +19 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -15
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.js +19 -15
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +19 -15
- package/internal/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/internal/dist/index.mjs
CHANGED
|
@@ -615,9 +615,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
615
615
|
completionTokens: (_h = (_g = response.usage) == null ? void 0 : _g.completion_tokens) != null ? _h : NaN
|
|
616
616
|
},
|
|
617
617
|
rawCall: { rawPrompt, rawSettings },
|
|
618
|
-
rawResponse: { headers: responseHeaders, body: rawResponse },
|
|
619
618
|
request: { body: JSON.stringify(body) },
|
|
620
|
-
response:
|
|
619
|
+
response: {
|
|
620
|
+
...getResponseMetadata(response),
|
|
621
|
+
headers: responseHeaders,
|
|
622
|
+
body: rawResponse
|
|
623
|
+
},
|
|
621
624
|
warnings,
|
|
622
625
|
logprobs: mapOpenAIChatLogProbsOutput(choice.logprobs),
|
|
623
626
|
providerMetadata
|
|
@@ -663,7 +666,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
663
666
|
return {
|
|
664
667
|
stream: simulatedStream,
|
|
665
668
|
rawCall: result.rawCall,
|
|
666
|
-
|
|
669
|
+
response: result.response,
|
|
667
670
|
warnings: result.warnings
|
|
668
671
|
};
|
|
669
672
|
}
|
|
@@ -873,7 +876,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
873
876
|
})
|
|
874
877
|
),
|
|
875
878
|
rawCall: { rawPrompt, rawSettings },
|
|
876
|
-
|
|
879
|
+
response: { headers: responseHeaders },
|
|
877
880
|
request: { body: JSON.stringify(body) },
|
|
878
881
|
warnings
|
|
879
882
|
};
|
|
@@ -1224,10 +1227,13 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1224
1227
|
finishReason: mapOpenAIFinishReason(choice.finish_reason),
|
|
1225
1228
|
logprobs: mapOpenAICompletionLogProbs(choice.logprobs),
|
|
1226
1229
|
rawCall: { rawPrompt, rawSettings },
|
|
1227
|
-
|
|
1228
|
-
response:
|
|
1229
|
-
|
|
1230
|
-
|
|
1230
|
+
request: { body: JSON.stringify(args) },
|
|
1231
|
+
response: {
|
|
1232
|
+
...getResponseMetadata(response),
|
|
1233
|
+
headers: responseHeaders,
|
|
1234
|
+
body: rawResponse
|
|
1235
|
+
},
|
|
1236
|
+
warnings
|
|
1231
1237
|
};
|
|
1232
1238
|
}
|
|
1233
1239
|
async doStream(options) {
|
|
@@ -1317,7 +1323,7 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1317
1323
|
})
|
|
1318
1324
|
),
|
|
1319
1325
|
rawCall: { rawPrompt, rawSettings },
|
|
1320
|
-
|
|
1326
|
+
response: { headers: responseHeaders },
|
|
1321
1327
|
warnings,
|
|
1322
1328
|
request: { body: JSON.stringify(body) }
|
|
1323
1329
|
};
|
|
@@ -2154,17 +2160,15 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2154
2160
|
rawPrompt: void 0,
|
|
2155
2161
|
rawSettings: {}
|
|
2156
2162
|
},
|
|
2157
|
-
rawResponse: {
|
|
2158
|
-
headers: responseHeaders,
|
|
2159
|
-
body: rawResponse
|
|
2160
|
-
},
|
|
2161
2163
|
request: {
|
|
2162
2164
|
body: JSON.stringify(body)
|
|
2163
2165
|
},
|
|
2164
2166
|
response: {
|
|
2165
2167
|
id: response.id,
|
|
2166
2168
|
timestamp: new Date(response.created_at * 1e3),
|
|
2167
|
-
modelId: response.model
|
|
2169
|
+
modelId: response.model,
|
|
2170
|
+
headers: responseHeaders,
|
|
2171
|
+
body: rawResponse
|
|
2168
2172
|
},
|
|
2169
2173
|
providerMetadata: {
|
|
2170
2174
|
openai: {
|
|
@@ -2306,8 +2310,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2306
2310
|
rawPrompt: void 0,
|
|
2307
2311
|
rawSettings: {}
|
|
2308
2312
|
},
|
|
2309
|
-
rawResponse: { headers: responseHeaders },
|
|
2310
2313
|
request: { body: JSON.stringify(body) },
|
|
2314
|
+
response: { headers: responseHeaders },
|
|
2311
2315
|
warnings
|
|
2312
2316
|
};
|
|
2313
2317
|
}
|