@ai-sdk/google 4.0.0 → 4.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -214,12 +214,10 @@ const googleFileResponseSchema = lazySchema(() =>
214
214
 
215
215
  const googleFilesUploadOptionsSchema = lazySchema(() =>
216
216
  zodSchema(
217
- z
218
- .object({
219
- displayName: z.string().nullish(),
220
- pollIntervalMs: z.number().positive().nullish(),
221
- pollTimeoutMs: z.number().positive().nullish(),
222
- })
223
- .passthrough(),
217
+ z.looseObject({
218
+ displayName: z.string().nullish(),
219
+ pollIntervalMs: z.number().positive().nullish(),
220
+ pollTimeoutMs: z.number().positive().nullish(),
221
+ }),
224
222
  ),
225
223
  );
@@ -21,23 +21,21 @@ export type GoogleVideoModelOptions = {
21
21
 
22
22
  export const googleVideoModelOptionsSchema = lazySchema(() =>
23
23
  zodSchema(
24
- z
25
- .object({
26
- pollIntervalMs: z.number().positive().nullish(),
27
- pollTimeoutMs: z.number().positive().nullish(),
28
- personGeneration: z
29
- .enum(['dont_allow', 'allow_adult', 'allow_all'])
30
- .nullish(),
31
- negativePrompt: z.string().nullish(),
32
- referenceImages: z
33
- .array(
34
- z.object({
35
- bytesBase64Encoded: z.string().nullish(),
36
- gcsUri: z.string().nullish(),
37
- }),
38
- )
39
- .nullish(),
40
- })
41
- .passthrough(),
24
+ z.looseObject({
25
+ pollIntervalMs: z.number().positive().nullish(),
26
+ pollTimeoutMs: z.number().positive().nullish(),
27
+ personGeneration: z
28
+ .enum(['dont_allow', 'allow_adult', 'allow_all'])
29
+ .nullish(),
30
+ negativePrompt: z.string().nullish(),
31
+ referenceImages: z
32
+ .array(
33
+ z.object({
34
+ bytesBase64Encoded: z.string().nullish(),
35
+ gcsUri: z.string().nullish(),
36
+ }),
37
+ )
38
+ .nullish(),
39
+ }),
42
40
  ),
43
41
  );
@@ -6,35 +6,33 @@ import {
6
6
  import { z } from 'zod/v4';
7
7
 
8
8
  /** Tool to retrieve knowledge from the File Search Stores. */
9
- const fileSearchArgsBaseSchema = z
10
- .object({
11
- /** The names of the file_search_stores to retrieve from.
12
- * Example: `fileSearchStores/my-file-search-store-123`
13
- */
14
- fileSearchStoreNames: z
15
- .array(z.string())
16
- .describe(
17
- 'The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`',
18
- ),
19
- /** The number of file search retrieval chunks to retrieve. */
20
- topK: z
21
- .number()
22
- .int()
23
- .positive()
24
- .describe('The number of file search retrieval chunks to retrieve.')
25
- .optional(),
9
+ const fileSearchArgsBaseSchema = z.looseObject({
10
+ /** The names of the file_search_stores to retrieve from.
11
+ * Example: `fileSearchStores/my-file-search-store-123`
12
+ */
13
+ fileSearchStoreNames: z
14
+ .array(z.string())
15
+ .describe(
16
+ 'The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`',
17
+ ),
18
+ /** The number of file search retrieval chunks to retrieve. */
19
+ topK: z
20
+ .number()
21
+ .int()
22
+ .positive()
23
+ .describe('The number of file search retrieval chunks to retrieve.')
24
+ .optional(),
26
25
 
27
- /** Metadata filter to apply to the file search retrieval documents.
28
- * See https://google.aip.dev/160 for the syntax of the filter expression.
29
- */
30
- metadataFilter: z
31
- .string()
32
- .describe(
33
- 'Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression.',
34
- )
35
- .optional(),
36
- })
37
- .passthrough();
26
+ /** Metadata filter to apply to the file search retrieval documents.
27
+ * See https://google.aip.dev/160 for the syntax of the filter expression.
28
+ */
29
+ metadataFilter: z
30
+ .string()
31
+ .describe(
32
+ 'Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression.',
33
+ )
34
+ .optional(),
35
+ });
38
36
 
39
37
  export type GoogleFileSearchToolArgs = z.infer<typeof fileSearchArgsBaseSchema>;
40
38
 
@@ -9,23 +9,21 @@ import { z } from 'zod/v4';
9
9
  // https://ai.google.dev/api/generate-content#GroundingSupport
10
10
  // https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-search
11
11
 
12
- export const googleSearchToolArgsBaseSchema = z
13
- .object({
14
- searchTypes: z
15
- .object({
16
- webSearch: z.object({}).optional(),
17
- imageSearch: z.object({}).optional(),
18
- })
19
- .optional(),
12
+ export const googleSearchToolArgsBaseSchema = z.looseObject({
13
+ searchTypes: z
14
+ .object({
15
+ webSearch: z.object({}).optional(),
16
+ imageSearch: z.object({}).optional(),
17
+ })
18
+ .optional(),
20
19
 
21
- timeRangeFilter: z
22
- .object({
23
- startTime: z.string(),
24
- endTime: z.string(),
25
- })
26
- .optional(),
27
- })
28
- .passthrough();
20
+ timeRangeFilter: z
21
+ .object({
22
+ startTime: z.string(),
23
+ endTime: z.string(),
24
+ })
25
+ .optional(),
26
+ });
29
27
 
30
28
  export type GoogleSearchToolArgs = z.infer<
31
29
  typeof googleSearchToolArgsBaseSchema