@ai-sdk/google 4.0.78 → 4.0.79
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.d.ts +13 -1
- package/dist/index.js +573 -397
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +26 -2
- package/dist/internal/index.js +370 -219
- package/dist/internal/index.js.map +1 -1
- package/docs/15-google.mdx +85 -14
- package/package.json +2 -2
- package/src/convert-to-google-messages.ts +28 -0
- package/src/google-embedding-model.ts +39 -8
- package/src/google-json-accumulator.ts +0 -1
- package/src/google-prompt.ts +12 -0
- package/src/google-speech-api.ts +2 -1
- package/src/google-speech-input.ts +64 -0
- package/src/google-speech-model-options.ts +28 -1
- package/src/google-speech-model.ts +137 -25
- package/src/internal/index.ts +1 -0
- package/src/tool/code-execution.ts +14 -10
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { createProviderExecutedToolFactory } from '@ai-sdk/provider-utils';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
|
|
4
|
+
export const codeExecutionInputSchema = z.object({
|
|
5
|
+
language: z.string().describe('The programming language of the code.'),
|
|
6
|
+
code: z.string().describe('The code to be executed.'),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const codeExecutionOutputSchema = z.object({
|
|
10
|
+
outcome: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
|
|
13
|
+
output: z.string().describe('The output from the code execution.'),
|
|
14
|
+
});
|
|
15
|
+
|
|
4
16
|
/**
|
|
5
17
|
* A tool that enables the model to generate and run Python code.
|
|
6
18
|
*
|
|
@@ -22,14 +34,6 @@ export const codeExecution = createProviderExecutedToolFactory<
|
|
|
22
34
|
{}
|
|
23
35
|
>({
|
|
24
36
|
id: 'google.code_execution',
|
|
25
|
-
inputSchema:
|
|
26
|
-
|
|
27
|
-
code: z.string().describe('The code to be executed.'),
|
|
28
|
-
}),
|
|
29
|
-
outputSchema: z.object({
|
|
30
|
-
outcome: z
|
|
31
|
-
.string()
|
|
32
|
-
.describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
|
|
33
|
-
output: z.string().describe('The output from the code execution.'),
|
|
34
|
-
}),
|
|
37
|
+
inputSchema: codeExecutionInputSchema,
|
|
38
|
+
outputSchema: codeExecutionOutputSchema,
|
|
35
39
|
});
|