@ai-sdk/google 4.0.0-canary.76 → 4.0.0-canary.78
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 +14 -0
- package/dist/index.js +21 -7
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +32 -2
- package/dist/internal/index.js +322 -48
- package/dist/internal/index.js.map +1 -1
- package/package.json +2 -2
- package/src/google-speech-model.ts +31 -6
- package/src/internal/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 4.0.0-canary.78
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2ce3c65: feat(provider/google-vertex): add Gemini text-to-speech (speech) model support
|
|
8
|
+
|
|
9
|
+
## 4.0.0-canary.77
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [ee798eb]
|
|
14
|
+
- Updated dependencies [daf6637]
|
|
15
|
+
- @ai-sdk/provider-utils@5.0.0-canary.45
|
|
16
|
+
|
|
3
17
|
## 4.0.0-canary.76
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@ai-sdk/provider-utils";
|
|
8
8
|
|
|
9
9
|
// src/version.ts
|
|
10
|
-
var VERSION = true ? "4.0.0-canary.
|
|
10
|
+
var VERSION = true ? "4.0.0-canary.78" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -3675,11 +3675,25 @@ var GoogleSpeechModel = class _GoogleSpeechModel {
|
|
|
3675
3675
|
providerOptions
|
|
3676
3676
|
}) {
|
|
3677
3677
|
const warnings = [];
|
|
3678
|
-
const
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3678
|
+
const providerOptionsNames = this.config.provider.includes("vertex") ? ["googleVertex", "vertex"] : ["google"];
|
|
3679
|
+
let googleOptions;
|
|
3680
|
+
for (const name of providerOptionsNames) {
|
|
3681
|
+
googleOptions = await parseProviderOptions6({
|
|
3682
|
+
provider: name,
|
|
3683
|
+
providerOptions,
|
|
3684
|
+
schema: googleSpeechProviderOptionsSchema
|
|
3685
|
+
});
|
|
3686
|
+
if (googleOptions != null) {
|
|
3687
|
+
break;
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
if (googleOptions == null && !providerOptionsNames.includes("google")) {
|
|
3691
|
+
googleOptions = await parseProviderOptions6({
|
|
3692
|
+
provider: "google",
|
|
3693
|
+
providerOptions,
|
|
3694
|
+
schema: googleSpeechProviderOptionsSchema
|
|
3695
|
+
});
|
|
3696
|
+
}
|
|
3683
3697
|
const multiSpeakerVoiceConfig = googleOptions == null ? void 0 : googleOptions.multiSpeakerVoiceConfig;
|
|
3684
3698
|
const speechConfig = multiSpeakerVoiceConfig ? { multiSpeakerVoiceConfig } : { voiceConfig: { prebuiltVoiceConfig: { voiceName: voice } } };
|
|
3685
3699
|
let promptText = text;
|
|
@@ -3719,7 +3733,7 @@ var GoogleSpeechModel = class _GoogleSpeechModel {
|
|
|
3719
3733
|
});
|
|
3720
3734
|
}
|
|
3721
3735
|
const requestBody = {
|
|
3722
|
-
contents: [{ parts: [{ text: promptText }] }],
|
|
3736
|
+
contents: [{ role: "user", parts: [{ text: promptText }] }],
|
|
3723
3737
|
generationConfig: {
|
|
3724
3738
|
responseModalities: ["AUDIO"],
|
|
3725
3739
|
speechConfig
|