@ai-sdk/openai 4.0.0-beta.28 → 4.0.0-beta.29
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 +4 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +3 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +3 -4
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/chat/openai-chat-language-model.ts +0 -1
package/dist/internal/index.js
CHANGED
|
@@ -879,7 +879,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
879
879
|
};
|
|
880
880
|
}
|
|
881
881
|
async doGenerate(options) {
|
|
882
|
-
var _a, _b, _c, _d, _e, _f
|
|
882
|
+
var _a, _b, _c, _d, _e, _f;
|
|
883
883
|
const { args: body, warnings } = await this.getArgs(options);
|
|
884
884
|
const {
|
|
885
885
|
responseHeaders,
|
|
@@ -923,7 +923,6 @@ var OpenAIChatLanguageModel = class {
|
|
|
923
923
|
});
|
|
924
924
|
}
|
|
925
925
|
const completionTokenDetails = (_d = response.usage) == null ? void 0 : _d.completion_tokens_details;
|
|
926
|
-
const promptTokenDetails = (_e = response.usage) == null ? void 0 : _e.prompt_tokens_details;
|
|
927
926
|
const providerMetadata = { openai: {} };
|
|
928
927
|
if ((completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens) != null) {
|
|
929
928
|
providerMetadata.openai.acceptedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens;
|
|
@@ -931,14 +930,14 @@ var OpenAIChatLanguageModel = class {
|
|
|
931
930
|
if ((completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens) != null) {
|
|
932
931
|
providerMetadata.openai.rejectedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens;
|
|
933
932
|
}
|
|
934
|
-
if (((
|
|
933
|
+
if (((_e = choice.logprobs) == null ? void 0 : _e.content) != null) {
|
|
935
934
|
providerMetadata.openai.logprobs = choice.logprobs.content;
|
|
936
935
|
}
|
|
937
936
|
return {
|
|
938
937
|
content,
|
|
939
938
|
finishReason: {
|
|
940
939
|
unified: mapOpenAIFinishReason(choice.finish_reason),
|
|
941
|
-
raw: (
|
|
940
|
+
raw: (_f = choice.finish_reason) != null ? _f : void 0
|
|
942
941
|
},
|
|
943
942
|
usage: convertOpenAIChatUsage(response.usage),
|
|
944
943
|
request: { body },
|