@ai-sdk/google 4.0.56 → 4.0.58
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 +16 -0
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/google-provider.ts +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 4.0.58
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [aa45741]
|
|
8
|
+
- @ai-sdk/provider@4.0.9
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.34
|
|
10
|
+
|
|
11
|
+
## 4.0.57
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 949ef93: fix(google): recognize Google Files URLs when using a baseUrl
|
|
16
|
+
- Updated dependencies [90192f1]
|
|
17
|
+
- @ai-sdk/provider-utils@5.0.33
|
|
18
|
+
|
|
3
19
|
## 4.0.56
|
|
4
20
|
|
|
5
21
|
### 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.
|
|
10
|
+
var VERSION = true ? "4.0.58" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -9013,6 +9013,8 @@ function validateGoogleSpeechTranslationInputAudioFormat(inputAudioFormat) {
|
|
|
9013
9013
|
}
|
|
9014
9014
|
|
|
9015
9015
|
// src/google-provider.ts
|
|
9016
|
+
var DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
9017
|
+
var googleFilesUrlPattern = /^https:\/\/generativelanguage\.googleapis\.com\/v1beta\/files\/.*$/;
|
|
9016
9018
|
var supportedExternalUrlMediaTypes = [
|
|
9017
9019
|
"text/html",
|
|
9018
9020
|
"text/css",
|
|
@@ -9043,7 +9045,7 @@ function supportsExternalFileUrls(modelId) {
|
|
|
9043
9045
|
}
|
|
9044
9046
|
function createGoogle(options = {}) {
|
|
9045
9047
|
var _a, _b;
|
|
9046
|
-
const baseURL = (_a = withoutTrailingSlash(options.baseURL)) != null ? _a :
|
|
9048
|
+
const baseURL = (_a = withoutTrailingSlash(options.baseURL)) != null ? _a : DEFAULT_BASE_URL;
|
|
9047
9049
|
const providerName = (_b = options.name) != null ? _b : "google.generative-ai";
|
|
9048
9050
|
const getHeaders = () => withUserAgentSuffix2(
|
|
9049
9051
|
{
|
|
@@ -9065,8 +9067,10 @@ function createGoogle(options = {}) {
|
|
|
9065
9067
|
generateId: (_a2 = options.generateId) != null ? _a2 : generateId3,
|
|
9066
9068
|
supportedUrls: () => ({
|
|
9067
9069
|
"*": [
|
|
9068
|
-
// Google Generative Language "files" endpoint
|
|
9070
|
+
// Default Google Generative Language "files" endpoint
|
|
9069
9071
|
// e.g. https://generativelanguage.googleapis.com/v1beta/files/...
|
|
9072
|
+
googleFilesUrlPattern,
|
|
9073
|
+
// Configured Google Generative Language "files" endpoint
|
|
9070
9074
|
new RegExp(`^${baseURL}/files/.*$`),
|
|
9071
9075
|
// YouTube URLs (public or unlisted videos)
|
|
9072
9076
|
new RegExp(
|