@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/dist/index.mjs
CHANGED
|
@@ -620,8 +620,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
620
620
|
promptTokens: (_f = (_e = response.usage) == null ? void 0 : _e.prompt_tokens) != null ? _f : NaN,
|
|
621
621
|
completionTokens: (_h = (_g = response.usage) == null ? void 0 : _g.completion_tokens) != null ? _h : NaN
|
|
622
622
|
},
|
|
623
|
-
|
|
624
|
-
request: { body: JSON.stringify(body) },
|
|
623
|
+
request: { body },
|
|
625
624
|
response: {
|
|
626
625
|
...getResponseMetadata(response),
|
|
627
626
|
headers: responseHeaders,
|
|
@@ -671,7 +670,6 @@ var OpenAIChatLanguageModel = class {
|
|
|
671
670
|
});
|
|
672
671
|
return {
|
|
673
672
|
stream: simulatedStream,
|
|
674
|
-
rawCall: result.rawCall,
|
|
675
673
|
response: result.response,
|
|
676
674
|
warnings: result.warnings
|
|
677
675
|
};
|
|
@@ -881,9 +879,8 @@ var OpenAIChatLanguageModel = class {
|
|
|
881
879
|
}
|
|
882
880
|
})
|
|
883
881
|
),
|
|
884
|
-
|
|
882
|
+
request: { body },
|
|
885
883
|
response: { headers: responseHeaders },
|
|
886
|
-
request: { body: JSON.stringify(body) },
|
|
887
884
|
warnings
|
|
888
885
|
};
|
|
889
886
|
}
|
|
@@ -1222,7 +1219,6 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1222
1219
|
abortSignal: options.abortSignal,
|
|
1223
1220
|
fetch: this.config.fetch
|
|
1224
1221
|
});
|
|
1225
|
-
const { prompt: rawPrompt, ...rawSettings } = args;
|
|
1226
1222
|
const choice = response.choices[0];
|
|
1227
1223
|
return {
|
|
1228
1224
|
text: choice.text,
|
|
@@ -1232,8 +1228,7 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1232
1228
|
},
|
|
1233
1229
|
finishReason: mapOpenAIFinishReason(choice.finish_reason),
|
|
1234
1230
|
logprobs: mapOpenAICompletionLogProbs(choice.logprobs),
|
|
1235
|
-
|
|
1236
|
-
request: { body: JSON.stringify(args) },
|
|
1231
|
+
request: { body: args },
|
|
1237
1232
|
response: {
|
|
1238
1233
|
...getResponseMetadata(response),
|
|
1239
1234
|
headers: responseHeaders,
|
|
@@ -1264,7 +1259,6 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1264
1259
|
abortSignal: options.abortSignal,
|
|
1265
1260
|
fetch: this.config.fetch
|
|
1266
1261
|
});
|
|
1267
|
-
const { prompt: rawPrompt, ...rawSettings } = args;
|
|
1268
1262
|
let finishReason = "unknown";
|
|
1269
1263
|
let usage = {
|
|
1270
1264
|
promptTokens: Number.NaN,
|
|
@@ -1328,7 +1322,6 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1328
1322
|
}
|
|
1329
1323
|
})
|
|
1330
1324
|
),
|
|
1331
|
-
rawCall: { rawPrompt, rawSettings },
|
|
1332
1325
|
response: { headers: responseHeaders },
|
|
1333
1326
|
warnings,
|
|
1334
1327
|
request: { body: JSON.stringify(body) }
|
|
@@ -2183,13 +2176,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2183
2176
|
promptTokens: response.usage.input_tokens,
|
|
2184
2177
|
completionTokens: response.usage.output_tokens
|
|
2185
2178
|
},
|
|
2186
|
-
|
|
2187
|
-
rawPrompt: void 0,
|
|
2188
|
-
rawSettings: {}
|
|
2189
|
-
},
|
|
2190
|
-
request: {
|
|
2191
|
-
body: JSON.stringify(body)
|
|
2192
|
-
},
|
|
2179
|
+
request: { body },
|
|
2193
2180
|
response: {
|
|
2194
2181
|
id: response.id,
|
|
2195
2182
|
timestamp: new Date(response.created_at * 1e3),
|
|
@@ -2333,11 +2320,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2333
2320
|
}
|
|
2334
2321
|
})
|
|
2335
2322
|
),
|
|
2336
|
-
|
|
2337
|
-
rawPrompt: void 0,
|
|
2338
|
-
rawSettings: {}
|
|
2339
|
-
},
|
|
2340
|
-
request: { body: JSON.stringify(body) },
|
|
2323
|
+
request: { body },
|
|
2341
2324
|
response: { headers: responseHeaders },
|
|
2342
2325
|
warnings
|
|
2343
2326
|
};
|