@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.mjs
CHANGED
|
@@ -840,7 +840,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
840
840
|
};
|
|
841
841
|
}
|
|
842
842
|
async doGenerate(options) {
|
|
843
|
-
var _a, _b, _c, _d, _e, _f
|
|
843
|
+
var _a, _b, _c, _d, _e, _f;
|
|
844
844
|
const { args: body, warnings } = await this.getArgs(options);
|
|
845
845
|
const {
|
|
846
846
|
responseHeaders,
|
|
@@ -884,7 +884,6 @@ var OpenAIChatLanguageModel = class {
|
|
|
884
884
|
});
|
|
885
885
|
}
|
|
886
886
|
const completionTokenDetails = (_d = response.usage) == null ? void 0 : _d.completion_tokens_details;
|
|
887
|
-
const promptTokenDetails = (_e = response.usage) == null ? void 0 : _e.prompt_tokens_details;
|
|
888
887
|
const providerMetadata = { openai: {} };
|
|
889
888
|
if ((completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens) != null) {
|
|
890
889
|
providerMetadata.openai.acceptedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens;
|
|
@@ -892,14 +891,14 @@ var OpenAIChatLanguageModel = class {
|
|
|
892
891
|
if ((completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens) != null) {
|
|
893
892
|
providerMetadata.openai.rejectedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens;
|
|
894
893
|
}
|
|
895
|
-
if (((
|
|
894
|
+
if (((_e = choice.logprobs) == null ? void 0 : _e.content) != null) {
|
|
896
895
|
providerMetadata.openai.logprobs = choice.logprobs.content;
|
|
897
896
|
}
|
|
898
897
|
return {
|
|
899
898
|
content,
|
|
900
899
|
finishReason: {
|
|
901
900
|
unified: mapOpenAIFinishReason(choice.finish_reason),
|
|
902
|
-
raw: (
|
|
901
|
+
raw: (_f = choice.finish_reason) != null ? _f : void 0
|
|
903
902
|
},
|
|
904
903
|
usage: convertOpenAIChatUsage(response.usage),
|
|
905
904
|
request: { body },
|