@ai-sdk/openai 1.3.9 → 1.3.10
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 +7 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +21 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -17
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.d.mts +16 -16
- package/internal/dist/index.d.ts +16 -16
- package/internal/dist/index.js +21 -17
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +21 -17
- package/internal/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -526,6 +526,15 @@ var OpenAIChatLanguageModel = class {
|
|
|
526
526
|
}
|
|
527
527
|
baseArgs.max_tokens = void 0;
|
|
528
528
|
}
|
|
529
|
+
} else if (this.modelId.startsWith("gpt-4o-search-preview")) {
|
|
530
|
+
if (baseArgs.temperature != null) {
|
|
531
|
+
baseArgs.temperature = void 0;
|
|
532
|
+
warnings.push({
|
|
533
|
+
type: "unsupported-setting",
|
|
534
|
+
setting: "temperature",
|
|
535
|
+
details: "temperature is not supported for the gpt-4o-search-preview model and has been removed."
|
|
536
|
+
});
|
|
537
|
+
}
|
|
529
538
|
}
|
|
530
539
|
switch (type) {
|
|
531
540
|
case "regular": {
|
|
@@ -1621,17 +1630,11 @@ import {
|
|
|
1621
1630
|
} from "@ai-sdk/provider-utils";
|
|
1622
1631
|
import { z as z6 } from "zod";
|
|
1623
1632
|
var OpenAIProviderOptionsSchema = z6.object({
|
|
1624
|
-
include: z6.array(z6.string()).
|
|
1625
|
-
|
|
1626
|
-
),
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
"An optional text to guide the model's style or continue a previous audio segment."
|
|
1630
|
-
),
|
|
1631
|
-
temperature: z6.number().min(0).max(1).optional().default(0).describe("The sampling temperature, between 0 and 1."),
|
|
1632
|
-
timestampGranularities: z6.array(z6.enum(["word", "segment"])).optional().default(["segment"]).describe(
|
|
1633
|
-
"The timestamp granularities to populate for this transcription."
|
|
1634
|
-
)
|
|
1633
|
+
include: z6.array(z6.string()).nullish(),
|
|
1634
|
+
language: z6.string().nullish(),
|
|
1635
|
+
prompt: z6.string().nullish(),
|
|
1636
|
+
temperature: z6.number().min(0).max(1).nullish().default(0),
|
|
1637
|
+
timestampGranularities: z6.array(z6.enum(["word", "segment"])).nullish().default(["segment"])
|
|
1635
1638
|
});
|
|
1636
1639
|
var languageMap = {
|
|
1637
1640
|
afrikaans: "af",
|
|
@@ -1706,6 +1709,7 @@ var OpenAITranscriptionModel = class {
|
|
|
1706
1709
|
mediaType,
|
|
1707
1710
|
providerOptions
|
|
1708
1711
|
}) {
|
|
1712
|
+
var _a, _b, _c, _d, _e;
|
|
1709
1713
|
const warnings = [];
|
|
1710
1714
|
const openAIOptions = parseProviderOptions({
|
|
1711
1715
|
provider: "openai",
|
|
@@ -1718,16 +1722,16 @@ var OpenAITranscriptionModel = class {
|
|
|
1718
1722
|
formData.append("file", new File([blob], "audio", { type: mediaType }));
|
|
1719
1723
|
if (openAIOptions) {
|
|
1720
1724
|
const transcriptionModelOptions = {
|
|
1721
|
-
include: openAIOptions.include,
|
|
1722
|
-
language: openAIOptions.language,
|
|
1723
|
-
prompt: openAIOptions.prompt,
|
|
1724
|
-
temperature: openAIOptions.temperature,
|
|
1725
|
-
timestamp_granularities: openAIOptions.timestampGranularities
|
|
1725
|
+
include: (_a = openAIOptions.include) != null ? _a : void 0,
|
|
1726
|
+
language: (_b = openAIOptions.language) != null ? _b : void 0,
|
|
1727
|
+
prompt: (_c = openAIOptions.prompt) != null ? _c : void 0,
|
|
1728
|
+
temperature: (_d = openAIOptions.temperature) != null ? _d : void 0,
|
|
1729
|
+
timestamp_granularities: (_e = openAIOptions.timestampGranularities) != null ? _e : void 0
|
|
1726
1730
|
};
|
|
1727
1731
|
for (const key in transcriptionModelOptions) {
|
|
1728
1732
|
const value = transcriptionModelOptions[key];
|
|
1729
1733
|
if (value !== void 0) {
|
|
1730
|
-
formData.append(key, value);
|
|
1734
|
+
formData.append(key, String(value));
|
|
1731
1735
|
}
|
|
1732
1736
|
}
|
|
1733
1737
|
}
|