@divyacon/piece-google-gemini 0.0.0-stage → 0.1.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.
Files changed (53) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +41 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/chat-gemini.action.d.ts +6 -0
  7. package/dist/lib/actions/chat-gemini.action.d.ts.map +1 -0
  8. package/dist/lib/actions/chat-gemini.action.js +74 -0
  9. package/dist/lib/actions/chat-gemini.action.js.map +1 -0
  10. package/dist/lib/actions/create-video.action.d.ts +11 -0
  11. package/dist/lib/actions/create-video.action.d.ts.map +1 -0
  12. package/dist/lib/actions/create-video.action.js +183 -0
  13. package/dist/lib/actions/create-video.action.js.map +1 -0
  14. package/dist/lib/actions/generate-content-from-image.action.d.ts +6 -0
  15. package/dist/lib/actions/generate-content-from-image.action.d.ts.map +1 -0
  16. package/dist/lib/actions/generate-content-from-image.action.js +66 -0
  17. package/dist/lib/actions/generate-content-from-image.action.js.map +1 -0
  18. package/dist/lib/actions/generate-content-with-file-search.d.ts +7 -0
  19. package/dist/lib/actions/generate-content-with-file-search.d.ts.map +1 -0
  20. package/dist/lib/actions/generate-content-with-file-search.js +83 -0
  21. package/dist/lib/actions/generate-content-with-file-search.js.map +1 -0
  22. package/dist/lib/actions/generate-content.action.d.ts +7 -0
  23. package/dist/lib/actions/generate-content.action.d.ts.map +1 -0
  24. package/dist/lib/actions/generate-content.action.js +192 -0
  25. package/dist/lib/actions/generate-content.action.js.map +1 -0
  26. package/dist/lib/actions/text-to-speech.action.d.ts +7 -0
  27. package/dist/lib/actions/text-to-speech.action.d.ts.map +1 -0
  28. package/dist/lib/actions/text-to-speech.action.js +137 -0
  29. package/dist/lib/actions/text-to-speech.action.js.map +1 -0
  30. package/dist/lib/auth.d.ts +2 -0
  31. package/dist/lib/auth.d.ts.map +1 -0
  32. package/dist/lib/auth.js +42 -0
  33. package/dist/lib/auth.js.map +1 -0
  34. package/dist/lib/common/common.d.ts +49 -0
  35. package/dist/lib/common/common.d.ts.map +1 -0
  36. package/dist/lib/common/common.js +84 -0
  37. package/dist/lib/common/common.js.map +1 -0
  38. package/dist/lib/output-schemas.d.ts +7 -0
  39. package/dist/lib/output-schemas.d.ts.map +1 -0
  40. package/dist/lib/output-schemas.js +129 -0
  41. package/dist/lib/output-schemas.js.map +1 -0
  42. package/package.json +51 -4
  43. package/src/index.ts +35 -0
  44. package/src/lib/actions/chat-gemini.action.ts +78 -0
  45. package/src/lib/actions/create-video.action.ts +206 -0
  46. package/src/lib/actions/generate-content-from-image.action.ts +67 -0
  47. package/src/lib/actions/generate-content-with-file-search.ts +82 -0
  48. package/src/lib/actions/generate-content.action.ts +199 -0
  49. package/src/lib/actions/text-to-speech.action.ts +143 -0
  50. package/src/lib/auth.ts +38 -0
  51. package/src/lib/common/common.ts +121 -0
  52. package/src/lib/output-schemas.ts +131 -0
  53. package/README.md +0 -3
@@ -0,0 +1,199 @@
1
+ import { googleGeminiAuth } from '../auth';
2
+ import { ApFile, DynamicPropsValue, Property, createAction } from '@agnocon/pieces-framework';
3
+ import { defaultLLM, getGeminiModelOptions } from '../common/common';
4
+ import { GenerateContentParameters, GoogleGenAI } from '@google/genai';
5
+ import { isEmpty } from '@agnocon/pieces-framework';
6
+ import { MarkdownVariant } from '@agnocon/pieces-framework';
7
+ import mime from 'mime-types';
8
+ import { generateContentActionOutputSchema } from '../output-schemas';
9
+
10
+ export const generateContentAction = createAction({
11
+ audience: 'both',
12
+ description: 'Generate content using Google Gemini using the "gemini-pro" model',
13
+ aiMetadata: { description: 'Runs a single stateless prompt through a Gemini text model and returns the generated text, optionally grounded by one built-in tool: Google Search for live web results, URL Context to fetch pages named in the prompt, Google Maps scoped to a latitude/longitude, or File Search over an uploaded file. Use this as the default Gemini text-generation call; prefer chat_gemini when the exchange needs conversation memory, generate_content_from_image when the input includes an image, and create_video or text-to-speech for non-text output. Not idempotent: each call produces a fresh completion, and the File Search mode additionally creates a new file search store.', idempotent: false },
14
+ displayName: 'Generate Content',
15
+ name: 'generate_content',
16
+ auth: googleGeminiAuth,
17
+ props: {
18
+ prompt: Property.LongText({
19
+ displayName: 'Prompt',
20
+ required: true,
21
+ description: 'The prompt to generate content from.',
22
+ }),
23
+ model: Property.Dropdown({
24
+ displayName: 'Model',
25
+ required: true,
26
+ description: 'The model which will generate the completion',
27
+ refreshers: [],
28
+ defaultValue: defaultLLM,
29
+ auth: googleGeminiAuth,
30
+ options: async ({ auth }) => getGeminiModelOptions({ auth }),
31
+ }),
32
+ toolType: Property.StaticDropdown({
33
+ displayName: 'Tool Type',
34
+ description: 'Select built-in tool to use with Gemini model.',
35
+ required: false,
36
+ options: {
37
+ disabled: false,
38
+ options: [
39
+ { label: 'Google Search', value: 'google-search' },
40
+ { label: 'File Search', value: 'file-search' },
41
+ { label: 'Google Maps', value: 'google-maps' },
42
+ { label: 'URL Context', value: 'url-context' },
43
+ ],
44
+ },
45
+ }),
46
+ toolProperties: Property.DynamicProperties({
47
+ displayName: 'Tool Config',
48
+ auth: googleGeminiAuth,
49
+ refreshers: ['toolType'],
50
+ required: false,
51
+ props: async ({ auth, toolType }) => {
52
+ if (!auth || !toolType) return {};
53
+
54
+ let props: DynamicPropsValue = {};
55
+
56
+ switch (toolType) {
57
+ case 'file-search':
58
+ props = {
59
+ file: Property.File({
60
+ displayName: 'File',
61
+ required: true,
62
+ description: 'File to use for search tool.',
63
+ }),
64
+ fileStoreName: Property.ShortText({
65
+ displayName: 'File Store Name',
66
+ required: true,
67
+ }),
68
+ };
69
+ break;
70
+ case 'url-context':
71
+ props = {
72
+ mrkdown: Property.MarkDown({
73
+ variant: MarkdownVariant.INFO,
74
+ value:
75
+ 'To use URL context tool, include one or more URLs directly in the prompt. Gemini will fetch and use the page content as additional context.',
76
+ }),
77
+ };
78
+ break;
79
+ case 'google-search':
80
+ props = {
81
+ mrkdown: Property.MarkDown({
82
+ variant: MarkdownVariant.INFO,
83
+ value:
84
+ 'To use Google Search tool, include a clear search query in the prompt. Gemini will use Google Search to retrieve up-to-date web information.',
85
+ }),
86
+ };
87
+ break;
88
+ case 'google-maps':
89
+ props = {
90
+ latitude: Property.Number({
91
+ displayName: 'Latitude',
92
+ required: true,
93
+ description: 'Provide the relevant location latitude.',
94
+ }),
95
+ longitude: Property.Number({
96
+ displayName: 'Longitude',
97
+ required: true,
98
+ description: 'Provide the relevant location longitude.',
99
+ }),
100
+ };
101
+ break;
102
+ default:
103
+ break;
104
+ }
105
+ return props;
106
+ },
107
+ }),
108
+ },
109
+ outputSchema: generateContentActionOutputSchema,
110
+ async run({ auth, propsValue }) {
111
+ const { model, prompt, toolType } = propsValue;
112
+ const toolProperties = propsValue.toolProperties ?? {};
113
+
114
+ const genAI = new GoogleGenAI({ apiKey: auth.secret_text });
115
+
116
+ const params: GenerateContentParameters = {
117
+ model,
118
+ contents: prompt,
119
+ };
120
+
121
+ const generate = async () => {
122
+ const response = await genAI.models.generateContent(params);
123
+ return response.text;
124
+ };
125
+
126
+ if (isEmpty(toolType)) {
127
+ return generate();
128
+ }
129
+
130
+ switch (toolType) {
131
+ case 'file-search': {
132
+ const { file, fileStoreName } = toolProperties as { file: ApFile; fileStoreName: string };
133
+
134
+ const fileBlob = new Blob([Buffer.from(file.base64, 'base64')], {
135
+ type: mime.lookup(file.extension || file.filename) || undefined,
136
+ });
137
+
138
+ const fileSearchStore = await genAI.fileSearchStores.create({
139
+ config: { displayName: fileStoreName },
140
+ });
141
+
142
+ let operation = await genAI.fileSearchStores.uploadToFileSearchStore({
143
+ file: fileBlob,
144
+ fileSearchStoreName: fileSearchStore.name!,
145
+ config: {
146
+ displayName: file.filename,
147
+ },
148
+ });
149
+ while (!operation.done) {
150
+ await new Promise((resolve) => setTimeout(resolve, 5000));
151
+ operation = await genAI.operations.get({ operation });
152
+ }
153
+
154
+ params.config = {
155
+ tools: [
156
+ {
157
+ fileSearch: {
158
+ fileSearchStoreNames: [fileSearchStore.name!],
159
+ },
160
+ },
161
+ ],
162
+ };
163
+
164
+ break;
165
+ }
166
+ case 'url-context': {
167
+ params.config = {
168
+ tools: [{ urlContext: {} }],
169
+ };
170
+ break;
171
+ }
172
+ case 'google-search': {
173
+ params.config = {
174
+ tools: [{ googleSearch: {} }],
175
+ };
176
+ break;
177
+ }
178
+ case 'google-maps': {
179
+ const { latitude, longitude } = toolProperties as { latitude: number; longitude: number };
180
+
181
+ params.config = {
182
+ tools: [{ googleMaps: {} }],
183
+ toolConfig: {
184
+ retrievalConfig: {
185
+ latLng: {
186
+ latitude,
187
+ longitude,
188
+ },
189
+ },
190
+ },
191
+ };
192
+
193
+ break;
194
+ }
195
+ }
196
+
197
+ return generate();
198
+ },
199
+ });
@@ -0,0 +1,143 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { googleGeminiAuth } from '../auth';
3
+ import { getGeminiTtsModelOptions } from '../common/common';
4
+ import { GoogleGenAI } from '@google/genai';
5
+ import wav from 'wav';
6
+ import { Writable } from 'stream';
7
+ import { textToSpeechActionOutputSchema } from '../output-schemas';
8
+
9
+ export const textToSpeechAction = createAction({
10
+ audience: 'both',
11
+ name: 'text-to-speech',
12
+ auth: googleGeminiAuth,
13
+ displayName: 'Text to Speech',
14
+ description: 'Converts text to audio file.',
15
+ aiMetadata: { description: 'Synthesizes spoken audio from input text using a Gemini TTS model and one of roughly thirty prebuilt named voices, returning a WAV file. This is the audio-output sibling of generate_content: use it when the flow needs speech instead of text, and create_video when it needs video. Requires a TTS-capable model, which the model dropdown restricts to. Not idempotent: each call renders a new audio file.', idempotent: false },
16
+ props: {
17
+ model: Property.Dropdown({
18
+ displayName: 'Model',
19
+ required: true,
20
+ auth: googleGeminiAuth,
21
+ refreshers: [],
22
+ options: async ({ auth }) => getGeminiTtsModelOptions({ auth }),
23
+ }),
24
+ text: Property.LongText({
25
+ displayName: 'Input Text',
26
+ required: true,
27
+ }),
28
+ voice: Property.StaticDropdown({
29
+ displayName: 'Voice',
30
+ required: true,
31
+ options: {
32
+ disabled: false,
33
+ options: [
34
+ { label: 'Zephyr (Bright)', value: 'Zephyr' },
35
+ { label: 'Puck (Upbeat)', value: 'Puck' },
36
+ { label: 'Charon (Informative)', value: 'Charon' },
37
+ { label: 'Kore (Firm)', value: 'Kore' },
38
+ { label: 'Fenrir (Excitable)', value: 'Fenrir' },
39
+ { label: 'Leda (Youthful)', value: 'Leda' },
40
+ { label: 'Orus (Firm)', value: 'Orus' },
41
+ { label: 'Aoede (Breezy)', value: 'Aoede' },
42
+ { label: 'Callirrhoe (Easy-going)', value: 'Callirrhoe' },
43
+ { label: 'Autonoe (Bright)', value: 'Autonoe' },
44
+ { label: 'Enceladus (Breathy)', value: 'Enceladus' },
45
+ { label: 'Iapetus (Clear)', value: 'Iapetus' },
46
+ { label: 'Umbriel (Easy-going)', value: 'Umbriel' },
47
+ { label: 'Algieba (Smooth)', value: 'Algieba' },
48
+ { label: 'Despina (Smooth)', value: 'Despina' },
49
+ { label: 'Erinome (Clear)', value: 'Erinome' },
50
+ { label: 'Algenib (Gravelly)', value: 'Algenib' },
51
+ { label: 'Rasalgethi (Informative)', value: 'Rasalgethi' },
52
+ { label: 'Laomedeia (Upbeat)', value: 'Laomedeia' },
53
+ { label: 'Achernar (Soft)', value: 'Achernar' },
54
+ { label: 'Alnilam (Firm)', value: 'Alnilam' },
55
+ { label: 'Schedar (Even)', value: 'Schedar' },
56
+ { label: 'Gacrux (Mature)', value: 'Gacrux' },
57
+ { label: 'Pulcherrima (Forward)', value: 'Pulcherrima' },
58
+ { label: 'Achird (Friendly)', value: 'Achird' },
59
+ { label: 'Zubenelgenubi (Casual)', value: 'Zubenelgenubi' },
60
+ { label: 'Vindemiatrix (Gentle)', value: 'Vindemiatrix' },
61
+ { label: 'Sadachbia (Lively)', value: 'Sadachbia' },
62
+ { label: 'Sadaltager (Knowledgeable)', value: 'Sadaltager' },
63
+ { label: 'Sulafat (Warm)', value: 'Sulafat' },
64
+ ],
65
+ },
66
+ }),
67
+ },
68
+ outputSchema: textToSpeechActionOutputSchema,
69
+ async run(context) {
70
+ const { text, model, voice } = context.propsValue;
71
+
72
+ try {
73
+ const genAI = new GoogleGenAI({ apiKey: context.auth.secret_text });
74
+
75
+ const response = await genAI.models.generateContent({
76
+ model,
77
+ contents: [{ parts: [{ text }] }],
78
+ config: {
79
+ responseModalities: ['AUDIO'],
80
+ speechConfig: {
81
+ voiceConfig: {
82
+ prebuiltVoiceConfig: { voiceName: voice },
83
+ },
84
+ },
85
+ },
86
+ });
87
+
88
+ const data =
89
+ response.candidates?.[0]?.content?.parts?.[0]?.inlineData?.data;
90
+
91
+ if (!data) {
92
+ throw new Error('No audio data returned from model response.');
93
+ }
94
+
95
+ const pcmBuffer = Buffer.from(data, 'base64');
96
+ const wavBuffer = await pcmToWavBuffer(pcmBuffer, 1, 24000, 2);
97
+
98
+ return await context.files.write({
99
+ data: wavBuffer,
100
+ fileName: 'audio.wav',
101
+ });
102
+
103
+ } catch (error) {
104
+ console.error('Error in generate content from image:', error);
105
+ throw error;
106
+ }
107
+ },
108
+ });
109
+
110
+ export async function pcmToWavBuffer(
111
+ pcmBuffer: Buffer,
112
+ channels = 1,
113
+ rate = 24000,
114
+ sampleWidth = 2
115
+ ): Promise<Buffer> {
116
+ return new Promise<Buffer>((resolve, reject) => {
117
+ const wavBuffers: Buffer[] = [];
118
+
119
+ const writer = new wav.Writer({
120
+ channels,
121
+ sampleRate: rate,
122
+ bitDepth: sampleWidth * 8,
123
+ });
124
+
125
+ const writable = new Writable({
126
+ write(chunk: Buffer, _encoding, callback) {
127
+ wavBuffers.push(chunk);
128
+ callback();
129
+ },
130
+ });
131
+
132
+ writer.pipe(writable);
133
+ writer.write(pcmBuffer);
134
+ writer.end();
135
+
136
+ writer.on('finish', () => {
137
+ const fullWavBuffer = Buffer.concat(wavBuffers);
138
+ resolve(fullWavBuffer);
139
+ });
140
+
141
+ writer.on('error', (err) => reject(err));
142
+ });
143
+ }
@@ -0,0 +1,38 @@
1
+ import { PieceAuth } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ const markdownDescription = `
5
+ Follow these instructions to get your API Key:
6
+ 1. Visit the following website: https://makersuite.google.com/app/apikey
7
+ 2. Once on the website, locate and click on the option to obtain your API Key.
8
+ Please note this piece uses a API in the beta phase that may change at any time.
9
+ `;
10
+
11
+ export const googleGeminiAuth = PieceAuth.SecretText({
12
+ description: markdownDescription,
13
+ displayName: 'API Key',
14
+ required: true,
15
+ validate: async (auth) => {
16
+ try {
17
+ await httpClient.sendRequest<{
18
+ data: { id: string }[];
19
+ }>({
20
+ url:
21
+ 'https://generativelanguage.googleapis.com/v1beta/models?key=' +
22
+ auth.auth,
23
+ method: HttpMethod.GET,
24
+ });
25
+ return {
26
+ valid: true,
27
+ };
28
+ } catch (e: any) {
29
+ const extraErrorInfo = e.response?.body?.error?.message
30
+ ? `${e.response?.body?.error?.message} status:${e.response?.body?.error?.code}`
31
+ : e;
32
+ return {
33
+ valid: false,
34
+ error: `${extraErrorInfo}`,
35
+ };
36
+ }
37
+ },
38
+ });
@@ -0,0 +1,121 @@
1
+ import {
2
+ httpClient,
3
+ HttpMethod,
4
+ HttpResponse,
5
+ QueryParams,
6
+ } from '@agnocon/pieces-common';
7
+ import { AppConnectionValueForAuthProperty } from '@agnocon/pieces-framework';
8
+ import { googleGeminiAuth } from '../auth';
9
+
10
+ export const defaultLLM = 'gemini-1.5-flash';
11
+
12
+ export const allowedLLMs = [
13
+ 'gemini-1.5-flash',
14
+ 'gemini-1.5-flash-8b',
15
+ 'gemini-1.5-pro',
16
+ 'gemini-2.0-flash',
17
+ 'gemini-2.0-flash-lite',
18
+ 'gemini-2.5-flash',
19
+ 'gemini-2.5-pro',
20
+ 'gemini-3-pro'
21
+ ];
22
+
23
+ const isAllowedLLM = (model: GeminiModel): boolean =>
24
+ allowedLLMs.some((allowed) => model.name.startsWith(`models/${allowed}`));
25
+
26
+ const isTtsModel = (model: GeminiModel): boolean =>
27
+ model.name.toLowerCase().includes('tts') ||
28
+ (model.displayName?.toLowerCase().includes('tts') ?? false);
29
+
30
+ const isVeoModel = (model: GeminiModel): boolean =>
31
+ model.name.toLowerCase().includes('veo');
32
+
33
+ const listAllModels = async ({
34
+ auth,
35
+ }: {
36
+ auth: GeminiAuth;
37
+ }): Promise<GeminiModel[]> => {
38
+ const models: GeminiModel[] = [];
39
+ let pageToken: string | undefined = undefined;
40
+
41
+ do {
42
+ const queryParams: QueryParams = {
43
+ key: auth.secret_text,
44
+ pageSize: '1000',
45
+ };
46
+ if (pageToken) {
47
+ queryParams['pageToken'] = pageToken;
48
+ }
49
+
50
+ const { body }: HttpResponse<GeminiListModelsResponse> =
51
+ await httpClient.sendRequest<GeminiListModelsResponse>({
52
+ method: HttpMethod.GET,
53
+ url: 'https://generativelanguage.googleapis.com/v1beta/models',
54
+ queryParams,
55
+ });
56
+ models.push(...(body.models ?? []));
57
+ pageToken = body.nextPageToken;
58
+ } while (pageToken);
59
+
60
+ return models;
61
+ };
62
+
63
+ const fetchModelOptions = async ({
64
+ auth,
65
+ filter,
66
+ }: {
67
+ auth?: GeminiAuth;
68
+ filter: (model: GeminiModel) => boolean;
69
+ }) => {
70
+ if (!auth) {
71
+ return {
72
+ disabled: true,
73
+ placeholder: 'Enter your API key first',
74
+ options: [],
75
+ };
76
+ }
77
+
78
+ try {
79
+ const models = await listAllModels({ auth });
80
+ const options = models.filter(filter).map((model) => ({
81
+ label: model.displayName ?? model.name.replace('models/', ''),
82
+ value: model.name.replace('models/', ''),
83
+ }));
84
+
85
+ return {
86
+ disabled: false,
87
+ options,
88
+ };
89
+ } catch {
90
+ return {
91
+ disabled: true,
92
+ options: [],
93
+ placeholder: "Couldn't load models, check your API key or try again.",
94
+ };
95
+ }
96
+ };
97
+
98
+ export const getGeminiModelOptions = async ({ auth }: { auth?: GeminiAuth }) =>
99
+ fetchModelOptions({ auth, filter: isAllowedLLM });
100
+
101
+ export const getGeminiTtsModelOptions = async ({ auth }: { auth?: GeminiAuth }) =>
102
+ fetchModelOptions({ auth, filter: isTtsModel });
103
+
104
+ export const getGeminiVideoModelOptions = async ({
105
+ auth,
106
+ }: {
107
+ auth?: GeminiAuth;
108
+ }) => fetchModelOptions({ auth, filter: isVeoModel });
109
+
110
+ type GeminiAuth = AppConnectionValueForAuthProperty<typeof googleGeminiAuth>;
111
+
112
+ type GeminiModel = {
113
+ name: string;
114
+ displayName?: string;
115
+ supportedGenerationMethods?: string[];
116
+ };
117
+
118
+ type GeminiListModelsResponse = {
119
+ models?: GeminiModel[];
120
+ nextPageToken?: string;
121
+ };
@@ -0,0 +1,131 @@
1
+ import { OutputSchema } from '@agnocon/pieces-framework';
2
+
3
+ export const generateContentActionOutputSchema: OutputSchema = {
4
+ fields: [
5
+ {
6
+ key: 'text',
7
+ label: 'Generated Content',
8
+ value: '',
9
+ },
10
+ ],
11
+ };
12
+
13
+ export const chatGeminiActionOutputSchema: OutputSchema = {
14
+ fields: [
15
+ {
16
+ key: 'response',
17
+ label: 'Response',
18
+ value: 'response',
19
+ },
20
+ {
21
+ key: 'history',
22
+ label: 'Conversation History',
23
+ value: 'history',
24
+ listItems: [
25
+ {
26
+ key: 'role',
27
+ label: 'Role',
28
+ value: 'role',
29
+ },
30
+ {
31
+ key: 'text',
32
+ label: 'Text',
33
+ value: 'parts[0].text',
34
+ },
35
+ ],
36
+ },
37
+ ],
38
+ };
39
+
40
+ export const generateContentFromImageActionOutputSchema: OutputSchema = {
41
+ fields: [
42
+ {
43
+ key: 'text',
44
+ label: 'Generated Text',
45
+ value: 'text',
46
+ },
47
+ {
48
+ key: 'modelVersion',
49
+ label: 'Model Version',
50
+ value: 'raw.modelVersion',
51
+ },
52
+ {
53
+ key: 'finishReason',
54
+ label: 'Finish Reason',
55
+ value: 'raw.candidates[0].finishReason',
56
+ },
57
+ {
58
+ key: 'candidates',
59
+ label: 'Candidates',
60
+ value: 'raw.candidates',
61
+ listItems: [
62
+ {
63
+ key: 'text',
64
+ label: 'Text',
65
+ value: 'content.parts[0].text',
66
+ },
67
+ {
68
+ key: 'role',
69
+ label: 'Role',
70
+ value: 'content.role',
71
+ },
72
+ {
73
+ key: 'finishReason',
74
+ label: 'Finish Reason',
75
+ value: 'finishReason',
76
+ },
77
+ ],
78
+ },
79
+ {
80
+ key: 'usageMetadata',
81
+ label: 'Usage Metadata',
82
+ value: 'raw.usageMetadata',
83
+ children: [
84
+ {
85
+ key: 'promptTokenCount',
86
+ label: 'Prompt Tokens',
87
+ value: 'promptTokenCount',
88
+ format: 'number',
89
+ },
90
+ {
91
+ key: 'candidatesTokenCount',
92
+ label: 'Candidates Tokens',
93
+ value: 'candidatesTokenCount',
94
+ format: 'number',
95
+ },
96
+ {
97
+ key: 'totalTokenCount',
98
+ label: 'Total Tokens',
99
+ value: 'totalTokenCount',
100
+ format: 'number',
101
+ },
102
+ {
103
+ key: 'serviceTier',
104
+ label: 'Service Tier',
105
+ value: 'serviceTier',
106
+ },
107
+ ],
108
+ },
109
+ ],
110
+ };
111
+
112
+ export const generateContentWithFilesearchActionOutputSchema: OutputSchema = {
113
+ fields: [
114
+ {
115
+ key: 'text',
116
+ label: 'Generated Content',
117
+ value: '',
118
+ },
119
+ ],
120
+ };
121
+
122
+ export const textToSpeechActionOutputSchema: OutputSchema = {
123
+ fields: [
124
+ {
125
+ key: 'audioFile',
126
+ label: 'Audio File URL',
127
+ value: '',
128
+ format: 'url',
129
+ },
130
+ ],
131
+ };
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.