in firestore-multimodal-genai/functions/src/generative-client/genkit.ts [103:140]
static createModelReference(
model: string,
provider: string
): ModelReference<any> | null {
const modelReferences =
provider === 'google-ai'
? [
gemini10ProGoogleAI,
gemini15FlashGoogleAI,
gemini15ProGoogleAI,
gemini20FlashGoogleAI,
gemini20FlashLiteGoogleAI,
gemini20FlashExpGoogleAI,
gemini20ProExp0205GoogleAI,
]
: [
gemini10ProVertexAI,
gemini15FlashVertexAI,
gemini15ProVertexAI,
gemini20FlashVertexAI,
gemini20FlashLiteVertexAI,
gemini20ProExp0205VertexAI,
gemini20Flash001VertexAI,
gemini20FlashLitePreview0205VertexAI,
];
const pluginName = provider === 'google-ai' ? 'googleai' : 'vertexai';
for (const modelReference of modelReferences) {
if (modelReference.name === `${pluginName}/${model}`) {
return modelReference;
}
if (modelReference.info?.versions?.includes(model)) {
return modelReference.withVersion(model);
}
}
return null;
}