Skip to content

feat(js/plugins/{googleai,vertexai}): implemented dynamic model listing for googleai, and new model lookup API for googleai & vertexai #2839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

pavelgj
Copy link
Collaborator

@pavelgj pavelgj commented Apr 29, 2025

model listing for vertexai is coming next (more work than expected).

new model lookup API:

import { googleAI } from '@genkit-ai/googleai';

await ai.generate({
  prompt: '...',
  model: googleAI.model('gemini-2.0-flash-001')
})
// can set config right on the model ref
googleAI.model('gemini-2.0-flash-001', { temperature: 0.7 })

similarly for vertexAI

import { vertexAI } from '@genkit-ai/vertexai';

await ai.generate({
  prompt: '...',
  model: vertexAI.model('gemini-2.0-flash-001')
})
// can set config right on the model ref
vertexAI.model('gemini-2.0-flash-001', { temperature: 0.7 })

similarly for embedders:

googleAI.embedder('text-embedder-004')
vertexAI.embedder('text-embedder-004')

models are dynamically listed in the dev ui, pulled from the plugin's listActions
image

Checklist (if applicable):

…ng for googleai, and new model lookup API for googleai & vertexai
@pavelgj pavelgj requested a review from ifielker April 29, 2025 15:17
@pavelgj pavelgj merged commit ae6dab1 into main Apr 29, 2025
5 checks passed
@pavelgj pavelgj deleted the pj/js-gemini-list-models branch April 29, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants