Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ next-env.d.ts

# Code Coverage
js/plugins/compat-oai/coverage/
.firebaserc
2 changes: 1 addition & 1 deletion go/genkit/genkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func LookupTool(g *Genkit, name string) ai.Tool {
// // Define the prompt
// capitalPrompt := genkit.DefinePrompt(g, "findCapital",
// ai.WithDescription("Finds the capital of a country."),
// ai.WithModelName("googleai/gemini-1.5-flash"), // Specify the model
// ai.WithModelName("googleai/gemini-2.5-flash"), // Specify the model
// ai.WithSystem("You are a helpful geography assistant."),
// ai.WithPrompt("What is the capital of {{country}}?"),
// ai.WithInputType(GeoInput{Country: "USA"}),
Expand Down
2 changes: 1 addition & 1 deletion go/samples/prompts-dir/prompts/example.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
model: googleai/gemini-1.5-flash
model: googleai/gemini-2.5-flash
config:
temperature: 0.9
input:
Expand Down
4 changes: 2 additions & 2 deletions js/doc-snippets/src/dotprompt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function fn09() {
// [START definePromptTempl]
const myPrompt = ai.definePrompt({
name: 'myPrompt',
model: 'googleai/gemini-1.5-flash',
model: 'googleai/gemini-2.5-flash',
input: {
schema: z.object({
name: z.string(),
Expand All @@ -168,7 +168,7 @@ function fn10() {
// [START definePromptFn]
const myPrompt = ai.definePrompt({
name: 'myPrompt',
model: 'googleai/gemini-1.5-flash',
model: 'googleai/gemini-2.5-flash',
input: {
schema: z.object({
name: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion js/doc-snippets/src/dotprompt/prompts/ex01.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
model: googleai/gemini-1.5-flash
model: googleai/gemini-2.5-flash
config:
temperature: 0.9
input:
Expand Down
2 changes: 1 addition & 1 deletion js/doc-snippets/src/dotprompt/prompts/ex02.prompt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
model: vertexai/gemini-1.5-flash
model: vertexai/gemini-2.5-flash
---
You are the world's most welcoming AI assistant. Greet the user and offer your assistance.
2 changes: 1 addition & 1 deletion js/doc-snippets/src/dotprompt/prompts/ex03.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
model: googleai/gemini-1.5-flash
model: googleai/gemini-2.5-flash
config:
temperature: 1.4
topK: 50
Expand Down
2 changes: 1 addition & 1 deletion js/doc-snippets/src/dotprompt/prompts/ex04.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
model: googleai/gemini-1.5-flash
model: googleai/gemini-2.5-flash
input:
schema:
theme?: string
Expand Down
2 changes: 1 addition & 1 deletion js/doc-snippets/src/dotprompt/prompts/ex05.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
model: googleai/gemini-1.5-flash
model: googleai/gemini-2.5-flash
input:
schema:
theme?: string
Expand Down
2 changes: 1 addition & 1 deletion js/doc-snippets/src/dotprompt/prompts/ex06.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
model: vertexai/gemini-1.5-flash
model: vertexai/gemini-2.5-flash
input:
schema:
userQuestion: string
Expand Down
2 changes: 1 addition & 1 deletion js/doc-snippets/src/dotprompt/prompts/ex08.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
model: vertexai/gemini-1.5-flash
model: vertexai/gemini-2.5-flash
input:
schema:
photoUrl: string
Expand Down
12 changes: 6 additions & 6 deletions js/genkit/src/genkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ export class Genkit implements HasRegistry {
* ```ts
* const ai = genkit({
* plugins: [googleAI()],
* model: gemini15Flash, // default model
* model: googleAI.model('gemini-2.5-flash'), // default model
* })
*
* const { text } = await ai.generate('hi');
Expand All @@ -674,7 +674,7 @@ export class Genkit implements HasRegistry {
* ```ts
* const ai = genkit({
* plugins: [googleAI()],
* model: gemini15Flash, // default model
* model: googleAI.model('gemini-2.5-flash'), // default model
* })
*
* const { text } = await ai.generate([
Expand Down Expand Up @@ -708,7 +708,7 @@ export class Genkit implements HasRegistry {
* ],
* messages: conversationHistory,
* tools: [ userInfoLookup ],
* model: gemini15Flash,
* model: googleAI.model('gemini-2.5-flash'),
* });
* ```
*/
Expand Down Expand Up @@ -750,7 +750,7 @@ export class Genkit implements HasRegistry {
* ```ts
* const ai = genkit({
* plugins: [googleAI()],
* model: gemini15Flash, // default model
* model: googleAI.model('gemini-2.5-flash'), // default model
* })
*
* const { response, stream } = ai.generateStream('hi');
Expand All @@ -770,7 +770,7 @@ export class Genkit implements HasRegistry {
* ```ts
* const ai = genkit({
* plugins: [googleAI()],
* model: gemini15Flash, // default model
* model: googleAI.model('gemini-2.5-flash'), // default model
* })
*
* const { response, stream } = ai.generateStream([
Expand Down Expand Up @@ -808,7 +808,7 @@ export class Genkit implements HasRegistry {
* ],
* messages: conversationHistory,
* tools: [ userInfoLookup ],
* model: gemini15Flash,
* model: googleAI.model('gemini-2.5-flash'),
* });
* for await (const chunk of stream) {
* console.log(chunk.text);
Expand Down
2 changes: 1 addition & 1 deletion js/genkit/tests/prompts/badSchemaRef.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
model: googleai/gemini-1.5-flash
model: googleai/gemini-2.5-flash
input:
schema: badSchemaRef1
output:
Expand Down
2 changes: 1 addition & 1 deletion js/genkit/tests/prompts/schemaRef.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
model: googleai/gemini-1.5-flash
model: googleai/gemini-2.5-flash
input:
schema: myInputSchema
output:
Expand Down
4 changes: 2 additions & 2 deletions js/plugins/checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
} from '@genkit-ai/checks';

// Import any models you would like to use.
import { gemini15Flash, googleAI } from '@genkit-ai/googleai';
import { googleAI } from '@genkit-ai/google-genai';

export const ai = genkit({
plugins: [
Expand All @@ -53,7 +53,7 @@ export const poemFlow = ai.defineFlow(
},
async (topic) => {
const { text } = await ai.generate({
model: gemini15Flash,
model: googleAI.model('gemini-2.5-flash'),
prompt: `Write a poem on this topic: ${topic}`,
// Add checks middleware to your generate calls.
use: [
Expand Down
10 changes: 3 additions & 7 deletions js/plugins/dev-local-vectorstore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ npm i --save @genkit-ai/dev-local-vectorstore

```ts
import { Document, genkit } from 'genkit';
import {
googleAI,
gemini20Flash, // Replaced gemini15Flash with gemini20Flash
textEmbeddingGecko001,
} from '@genkit-ai/googleai';
import { googleAI } from '@genkit-ai/google-genai';
import {
devLocalVectorstore,
devLocalIndexerRef,
Expand All @@ -31,11 +27,11 @@ const ai = genkit({
devLocalVectorstore([
{
indexName: 'BobFacts',
embedder: textEmbeddingGecko001,
embedder: googleAI.embedder('text-embedding-004'),
},
]),
],
model: gemini20Flash, // Use gemini20Flash
model: googleAI.model('gemini-2.5-flash'),
});

// Reference to a local vector database storing Genkit documentation
Expand Down
2 changes: 1 addition & 1 deletion js/plugins/express/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import express from 'express';

const simpleFlow = ai.defineFlow('simpleFlow', async (input, { sendChunk }) => {
const { text } = await ai.generate({
model: gemini15Flash,
model: googleAI.model('gemini-2.5-flash'),
prompt: input,
onChunk: (c) => sendChunk(c.text),
});
Expand Down
1 change: 0 additions & 1 deletion js/plugins/google-genai/src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,6 @@ export declare interface GenerationConfig {
/**
* Optional. Positive values penalize tokens that repeatedly appear in the generated text, decreasing the probability of repeating content.
* This maximum value for frequencyPenalty is up to, but not including, 2.0. Its minimum value is -2.0.
* Supported by gemini-1.5-pro and gemini-1.5-flash only. */
frequencyPenalty?: number;
/**
* Google AI Only. If True, export the logprobs results in response.
Expand Down
8 changes: 4 additions & 4 deletions js/plugins/google-genai/tests/common/utils_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ describe('Common Utils', () => {
});

it('should extract version from name if version field is missing', () => {
const ref = modelRef({ name: 'vertexai/gemini-1.5-flash' });
assert.strictEqual(extractVersion(ref), 'gemini-1.5-flash');
const ref = modelRef({ name: 'vertexai/gemini-2.5-flash' });
assert.strictEqual(extractVersion(ref), 'gemini-2.5-flash');
});

it('should work with embedderRef', () => {
Expand All @@ -79,8 +79,8 @@ describe('Common Utils', () => {
'gemini-1.5-pro'
);
assert.strictEqual(
modelName('vertexai/gemini-1.5-flash'),
'gemini-1.5-flash'
modelName('vertexai/gemini-2.5-flash'),
'gemini-2.5-flash'
);
assert.strictEqual(modelName('model/foo'), 'foo');
assert.strictEqual(modelName('embedders/bar'), 'bar');
Expand Down
4 changes: 2 additions & 2 deletions js/plugins/google-genai/tests/googleai/index_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ describe('GoogleAI Plugin', () => {
it('should filter out deprecated models', async () => {
const mockModels = [
{
name: 'models/gemini-1.5-flash',
name: 'models/gemini-2.5-flash',
supportedGenerationMethods: ['generateContent'],
},
{
Expand Down Expand Up @@ -517,7 +517,7 @@ describe('GoogleAI Plugin', () => {
const plugin = googleAI();
const actions = await plugin.list!();
const actionNames = actions.map((a) => a.name);
assert.deepStrictEqual(actionNames, ['googleai/gemini-1.5-flash']);
assert.deepStrictEqual(actionNames, ['googleai/gemini-2.5-flash']);
});

it('should handle fetch errors gracefully', async () => {
Expand Down
6 changes: 3 additions & 3 deletions js/plugins/google-genai/tests/vertexai/index_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ describe('VertexAI Plugin', () => {
});

it('should use auth token for Gemini generateContent', async () => {
const modelRef = vertexAI.model('gemini-1.5-flash');
const modelRef = vertexAI.model('gemini-2.5-flash');
const generateAction = await ai.registry.lookupAction(
'/model/' + modelRef.name
);
Expand Down Expand Up @@ -442,7 +442,7 @@ describe('VertexAI Plugin', () => {
});

it('should use API key for Gemini generateContent', async () => {
const modelRef = vertexAI.model('gemini-1.5-flash');
const modelRef = vertexAI.model('gemini-2.5-flash');
const generateAction = await ai.registry.lookupAction(
'/model/' + modelRef.name
);
Expand Down Expand Up @@ -537,7 +537,7 @@ describe('VertexAI Plugin', () => {
});

it('should use API key for Gemini generateContent', async () => {
const modelRef = vertexAI.model('gemini-1.5-flash');
const modelRef = vertexAI.model('gemini-2.5-flash');
const generateAction = await ai.registry.lookupAction(
'/model/' + modelRef.name
);
Expand Down
2 changes: 1 addition & 1 deletion js/plugins/googleai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { googleAI, gemini } from '@genkit-ai/googleai';

const ai = genkit({
plugins: [googleAI()],
model: gemini('gemini-1.5-flash'),
model: gemini('gemini-2.5-flash'),
});

async () => {
Expand Down
2 changes: 1 addition & 1 deletion js/plugins/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const simpleFlow = ai.defineFlow(
'simpleFlow',
async (input, streamingCallback) => {
const { text } = await ai.generate({
model: gemini15Flash,
model: googleAI.model('gemini-2.5-flash'),
prompt: input,
streamingCallback: (chunk) => streamingCallback(chunk.text),
});
Expand Down
4 changes: 2 additions & 2 deletions js/plugins/vertexai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ npm i --save @genkit-ai/vertexai

```ts
import { genkit } from 'genkit';
import { vertexAI, gemini, gemini15Flash } from '@genkit-ai/vertexai';
import { vertexAI } from '@genkit-ai/vertexai';

const ai = genkit({
plugins: [vertexAI()],
model: gemini15Flash,
model: vertexAI.model('gemini-2.5-flash'),
});

async () => {
Expand Down
Loading
Loading