File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const vertexAdapter = new KurtVertexAI({
88 project : process . env . VERTEX_AI_PROJECT ?? "my-project" ,
99 location : process . env . VERTEX_AI_LOCATION ?? "us-central1" ,
1010 } ) ,
11- model : "gemini-1.0 -pro" , // or any other supported model
11+ model : "gemini-1.5 -pro" , // or any other supported model
1212} )
1313
1414const kurt = new Kurt ( vertexAdapter )
Original file line number Diff line number Diff line change 11import { expect , test } from "@jest/globals"
2- import {
3- KurtVertexAI ,
4- type KurtVertexAISupportedModel ,
5- } from "../src/KurtVertexAI"
2+ import { KurtVertexAI , type KurtVertexAISupportedModel } from "../src"
63
74test ( "KurtVertexAI.isSupportedModel" , ( ) => {
85 // For updating this test, the current list of models can be found at:
9- // https://platform.openai.com/ docs/models/overview
6+ // https://ai.google.dev/gemini-api/ docs/models/gemini
107 expect ( KurtVertexAI . isSupportedModel ( "gemini-1.5-pro" ) ) . toBe ( true )
11- expect ( KurtVertexAI . isSupportedModel ( "gemini-1.0-pro" ) ) . toBe ( true )
8+ expect ( KurtVertexAI . isSupportedModel ( "gemini-1.5-flash" ) ) . toBe ( true )
9+ expect ( KurtVertexAI . isSupportedModel ( "gemini-1.5-flash-8b" ) ) . toBe ( true )
10+ expect ( KurtVertexAI . isSupportedModel ( "gemini-2.0-flash" ) ) . toBe ( true )
11+ expect ( KurtVertexAI . isSupportedModel ( "gemini-1.0-pro" ) ) . toBe ( false )
1212 expect ( KurtVertexAI . isSupportedModel ( "gemini-1.0-pro-vision" ) ) . toBe ( false )
1313
1414 expect ( KurtVertexAI . isSupportedModel ( "bogus" ) ) . toBe ( false )
1515
1616 // The below code proves that the function works as a type guard.
17- const modelName = "gemini-1.0 -pro"
17+ const modelName = "gemini-1.5 -pro"
1818 if ( KurtVertexAI . isSupportedModel ( modelName ) ) {
1919 const modelNameGood : KurtVertexAISupportedModel = modelName
2020 }
Original file line number Diff line number Diff line change @@ -34,7 +34,12 @@ import type {
3434import { ZodError } from "zod"
3535
3636// These models support function calling.
37- const COMPATIBLE_MODELS = [ "gemini-1.0-pro" , "gemini-1.5-pro" ] as const
37+ const COMPATIBLE_MODELS = [
38+ "gemini-1.5-pro" ,
39+ "gemini-1.5-flash" ,
40+ "gemini-1.5-flash-8b" ,
41+ "gemini-2.0-flash" ,
42+ ] as const
3843
3944export type KurtVertexAISupportedModel = ( typeof COMPATIBLE_MODELS ) [ number ]
4045
You can’t perform that action at this time.
0 commit comments