@ai-sdk/openai 4.0.0-canary.59 → 4.0.0-canary.62
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 +22 -0
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +10 -4
- package/dist/internal/index.js.map +1 -1
- package/package.json +7 -7
- package/src/transcription/openai-transcription-model.ts +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.0-canary.62
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bf837fe: feat(provider/gateway): add speech and transcription model support
|
|
8
|
+
|
|
9
|
+
## 4.0.0-canary.61
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
|
|
14
|
+
- Updated dependencies [7fc6bd6]
|
|
15
|
+
- @ai-sdk/provider-utils@5.0.0-canary.43
|
|
16
|
+
- @ai-sdk/provider@4.0.0-canary.17
|
|
17
|
+
|
|
18
|
+
## 4.0.0-canary.60
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [a6617c5]
|
|
23
|
+
- @ai-sdk/provider-utils@5.0.0-canary.42
|
|
24
|
+
|
|
3
25
|
## 4.0.0-canary.59
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -7139,17 +7139,23 @@ var OpenAITranscriptionModel = class _OpenAITranscriptionModel {
|
|
|
7139
7139
|
new File([blob], "audio", { type: mediaType }),
|
|
7140
7140
|
`audio.${fileExtension}`
|
|
7141
7141
|
);
|
|
7142
|
+
if (this.modelId === "whisper-1") {
|
|
7143
|
+
formData.append("response_format", "verbose_json");
|
|
7144
|
+
}
|
|
7142
7145
|
if (openAIOptions) {
|
|
7146
|
+
const isGpt4oTranscribeModel = [
|
|
7147
|
+
"gpt-4o-transcribe",
|
|
7148
|
+
"gpt-4o-mini-transcribe"
|
|
7149
|
+
].includes(this.modelId);
|
|
7143
7150
|
const transcriptionModelOptions = {
|
|
7144
7151
|
include: openAIOptions.include,
|
|
7145
7152
|
language: openAIOptions.language,
|
|
7146
7153
|
prompt: openAIOptions.prompt,
|
|
7147
7154
|
// https://platform.openai.com/docs/api-reference/audio/createTranscription#audio_createtranscription-response_format
|
|
7148
7155
|
// prefer verbose_json to get segments for models that support it
|
|
7149
|
-
|
|
7150
|
-
"
|
|
7151
|
-
|
|
7152
|
-
].includes(this.modelId) ? "json" : "verbose_json",
|
|
7156
|
+
...this.modelId !== "whisper-1" && {
|
|
7157
|
+
response_format: isGpt4oTranscribeModel ? "json" : "verbose_json"
|
|
7158
|
+
},
|
|
7153
7159
|
temperature: openAIOptions.temperature,
|
|
7154
7160
|
timestamp_granularities: openAIOptions.timestampGranularities
|
|
7155
7161
|
};
|
|
@@ -7302,7 +7308,7 @@ var OpenAISkills = class {
|
|
|
7302
7308
|
};
|
|
7303
7309
|
|
|
7304
7310
|
// src/version.ts
|
|
7305
|
-
var VERSION = true ? "4.0.0-canary.
|
|
7311
|
+
var VERSION = true ? "4.0.0-canary.62" : "0.0.0-test";
|
|
7306
7312
|
|
|
7307
7313
|
// src/openai-provider.ts
|
|
7308
7314
|
function createOpenAI(options = {}) {
|