From b7610c01f66c2fad034cc7def589ef3b07e23336 Mon Sep 17 00:00:00 2001 From: Pavel Jbanov Date: Tue, 5 Nov 2024 20:44:36 +0000 Subject: [PATCH] chore: bump google ai sdk version (0.16.0 -> 0.21.0) (#1178) --- js/plugins/googleai/package.json | 2 +- js/plugins/googleai/src/gemini.ts | 8 ++++---- js/pnpm-lock.yaml | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/plugins/googleai/package.json b/js/plugins/googleai/package.json index c51e7de68..6be1a17e3 100644 --- a/js/plugins/googleai/package.json +++ b/js/plugins/googleai/package.json @@ -31,7 +31,7 @@ "author": "genkit", "license": "Apache-2.0", "dependencies": { - "@google/generative-ai": "^0.16.0", + "@google/generative-ai": "^0.21.0", "google-auth-library": "^9.6.3", "node-fetch": "^3.3.2" }, diff --git a/js/plugins/googleai/src/gemini.ts b/js/plugins/googleai/src/gemini.ts index 8bda18a3e..05c966637 100644 --- a/js/plugins/googleai/src/gemini.ts +++ b/js/plugins/googleai/src/gemini.ts @@ -18,7 +18,6 @@ import { FileDataPart, FunctionCallPart, FunctionDeclaration, - FunctionDeclarationSchemaType, FunctionResponsePart, GenerateContentCandidate as GeminiCandidate, Content as GeminiMessage, @@ -28,6 +27,7 @@ import { GoogleGenerativeAI, InlineDataPart, RequestOptions, + SchemaType, StartChatParams, Tool, } from '@google/generative-ai'; @@ -200,18 +200,18 @@ function convertSchemaProperty(property) { nestedProperties[key] = convertSchemaProperty(property.properties[key]); }); return { - type: FunctionDeclarationSchemaType.OBJECT, + type: SchemaType.OBJECT, properties: nestedProperties, required: property.required, }; } else if (property.type === 'array') { return { - type: FunctionDeclarationSchemaType.ARRAY, + type: SchemaType.ARRAY, items: convertSchemaProperty(property.items), }; } else { return { - type: FunctionDeclarationSchemaType[property.type.toUpperCase()], + type: SchemaType[property.type.toUpperCase()], }; } } diff --git a/js/pnpm-lock.yaml b/js/pnpm-lock.yaml index 9aac0204a..7a9a8ed99 100644 --- a/js/pnpm-lock.yaml +++ b/js/pnpm-lock.yaml @@ -484,8 +484,8 @@ importers: plugins/googleai: dependencies: '@google/generative-ai': - specifier: ^0.16.0 - version: 0.16.0 + specifier: ^0.21.0 + version: 0.21.0 genkit: specifier: workspace:* version: link:../../genkit @@ -2019,8 +2019,8 @@ packages: resolution: {integrity: sha512-zs37judcTYFJf1U7tnuqnh7gdzF6dcWj9pNRxjA5JTONRoiQ0htrRdbefRFiewOIfXwhun5t9hbd2ray7812eQ==} engines: {node: '>=18.0.0'} - '@google/generative-ai@0.16.0': - resolution: {integrity: sha512-doB5ZNxS6m+jUZqaLCeYXfBZCdq6Ho0ibkq5/17xe1qAUZpCLWlvCDGtqFPqqO+yezNmvGatS0KhV22yiOT3DA==} + '@google/generative-ai@0.21.0': + resolution: {integrity: sha512-7XhUbtnlkSEZK15kN3t+tzIMxsbKm/dSkKBFalj+20NvPKe1kBY7mR2P7vuijEn+f06z5+A8bVGKO0v39cr6Wg==} engines: {node: '>=18.0.0'} '@grpc/grpc-js@1.10.10': @@ -6947,7 +6947,7 @@ snapshots: '@google/generative-ai@0.15.0': {} - '@google/generative-ai@0.16.0': {} + '@google/generative-ai@0.21.0': {} '@grpc/grpc-js@1.10.10': dependencies: