@ai-sdk/openai 2.0.0-canary.4 → 2.0.0-canary.5
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 +5 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -22
- package/dist/index.mjs.map +1 -1
- package/{internal/dist → dist/internal}/index.js +5 -22
- package/dist/internal/index.js.map +1 -0
- package/{internal/dist → dist/internal}/index.mjs +5 -22
- package/dist/internal/index.mjs.map +1 -0
- package/package.json +11 -12
- package/internal/dist/index.js.map +0 -1
- package/internal/dist/index.mjs.map +0 -1
- /package/{internal/dist → dist/internal}/index.d.mts +0 -0
- /package/{internal/dist → dist/internal}/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -630,8 +630,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
630
630
|
promptTokens: (_f = (_e = response.usage) == null ? void 0 : _e.prompt_tokens) != null ? _f : NaN,
|
|
631
631
|
completionTokens: (_h = (_g = response.usage) == null ? void 0 : _g.completion_tokens) != null ? _h : NaN
|
|
632
632
|
},
|
|
633
|
-
|
|
634
|
-
request: { body: JSON.stringify(body) },
|
|
633
|
+
request: { body },
|
|
635
634
|
response: {
|
|
636
635
|
...getResponseMetadata(response),
|
|
637
636
|
headers: responseHeaders,
|
|
@@ -681,7 +680,6 @@ var OpenAIChatLanguageModel = class {
|
|
|
681
680
|
});
|
|
682
681
|
return {
|
|
683
682
|
stream: simulatedStream,
|
|
684
|
-
rawCall: result.rawCall,
|
|
685
683
|
response: result.response,
|
|
686
684
|
warnings: result.warnings
|
|
687
685
|
};
|
|
@@ -891,9 +889,8 @@ var OpenAIChatLanguageModel = class {
|
|
|
891
889
|
}
|
|
892
890
|
})
|
|
893
891
|
),
|
|
894
|
-
|
|
892
|
+
request: { body },
|
|
895
893
|
response: { headers: responseHeaders },
|
|
896
|
-
request: { body: JSON.stringify(body) },
|
|
897
894
|
warnings
|
|
898
895
|
};
|
|
899
896
|
}
|
|
@@ -1224,7 +1221,6 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1224
1221
|
abortSignal: options.abortSignal,
|
|
1225
1222
|
fetch: this.config.fetch
|
|
1226
1223
|
});
|
|
1227
|
-
const { prompt: rawPrompt, ...rawSettings } = args;
|
|
1228
1224
|
const choice = response.choices[0];
|
|
1229
1225
|
return {
|
|
1230
1226
|
text: choice.text,
|
|
@@ -1234,8 +1230,7 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1234
1230
|
},
|
|
1235
1231
|
finishReason: mapOpenAIFinishReason(choice.finish_reason),
|
|
1236
1232
|
logprobs: mapOpenAICompletionLogProbs(choice.logprobs),
|
|
1237
|
-
|
|
1238
|
-
request: { body: JSON.stringify(args) },
|
|
1233
|
+
request: { body: args },
|
|
1239
1234
|
response: {
|
|
1240
1235
|
...getResponseMetadata(response),
|
|
1241
1236
|
headers: responseHeaders,
|
|
@@ -1266,7 +1261,6 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1266
1261
|
abortSignal: options.abortSignal,
|
|
1267
1262
|
fetch: this.config.fetch
|
|
1268
1263
|
});
|
|
1269
|
-
const { prompt: rawPrompt, ...rawSettings } = args;
|
|
1270
1264
|
let finishReason = "unknown";
|
|
1271
1265
|
let usage = {
|
|
1272
1266
|
promptTokens: Number.NaN,
|
|
@@ -1330,7 +1324,6 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1330
1324
|
}
|
|
1331
1325
|
})
|
|
1332
1326
|
),
|
|
1333
|
-
rawCall: { rawPrompt, rawSettings },
|
|
1334
1327
|
response: { headers: responseHeaders },
|
|
1335
1328
|
warnings,
|
|
1336
1329
|
request: { body: JSON.stringify(body) }
|
|
@@ -2158,13 +2151,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2158
2151
|
promptTokens: response.usage.input_tokens,
|
|
2159
2152
|
completionTokens: response.usage.output_tokens
|
|
2160
2153
|
},
|
|
2161
|
-
|
|
2162
|
-
rawPrompt: void 0,
|
|
2163
|
-
rawSettings: {}
|
|
2164
|
-
},
|
|
2165
|
-
request: {
|
|
2166
|
-
body: JSON.stringify(body)
|
|
2167
|
-
},
|
|
2154
|
+
request: { body },
|
|
2168
2155
|
response: {
|
|
2169
2156
|
id: response.id,
|
|
2170
2157
|
timestamp: new Date(response.created_at * 1e3),
|
|
@@ -2308,11 +2295,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2308
2295
|
}
|
|
2309
2296
|
})
|
|
2310
2297
|
),
|
|
2311
|
-
|
|
2312
|
-
rawPrompt: void 0,
|
|
2313
|
-
rawSettings: {}
|
|
2314
|
-
},
|
|
2315
|
-
request: { body: JSON.stringify(body) },
|
|
2298
|
+
request: { body },
|
|
2316
2299
|
response: { headers: responseHeaders },
|
|
2317
2300
|
warnings
|
|
2318
2301
|
};
|