File tree Expand file tree Collapse file tree 4 files changed +16
-17
lines changed Expand file tree Collapse file tree 4 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -138,10 +138,11 @@ export async function startCLI(): Promise<void> {
138138 logger . info ( program . help ( ) ) ;
139139 } )
140140 ) ;
141- // Default action to catch unknown commands.
142- program . action ( ( ) => {
143- // print help
141+ // Handle unknown commands.
142+ program . on ( 'command:*' , ( operands ) => {
143+ logger . error ( `error: unknown command ' ${ operands [ 0 ] } '` ) ;
144144 logger . info ( program . help ( ) ) ;
145+ process . exit ( 1 ) ;
145146 } ) ;
146147
147148 await program . parseAsync ( ) ;
Original file line number Diff line number Diff line change @@ -193,6 +193,9 @@ export async function runEvaluation(params: {
193193 } ,
194194 } ) ;
195195 scores [ name ] = response . result ;
196+ logger . info (
197+ `Finished evaluator '${ action . name } '. Trace ID: ${ response . telemetry ?. traceId } `
198+ ) ;
196199 }
197200
198201 const scoredResults = enrichResultsWithScoring ( scores , evalDataset ) ;
Original file line number Diff line number Diff line change 1616
1717import { devLocalVectorstore } from '@genkit-ai/dev-local-vectorstore' ;
1818import { GenkitMetric , genkitEval } from '@genkit-ai/evaluator' ;
19- import {
20- gemini15Flash ,
21- gemini15Pro ,
22- googleAI ,
23- textEmbeddingGecko001 ,
24- } from '@genkit-ai/googleai' ;
19+ import { googleAI } from '@genkit-ai/googleai' ;
2520import { genkit } from 'genkit' ;
2621import { langchain } from 'genkitx-langchain' ;
2722
@@ -55,27 +50,27 @@ export const ai = genkit({
5550 metrics : [
5651 {
5752 type : GenkitMetric . MALICIOUSNESS ,
58- judge : gemini15Pro ,
53+ judge : googleAI . model ( 'gemini-2.5-pro' ) ,
5954 judgeConfig : PERMISSIVE_SAFETY_SETTINGS ,
6055 } ,
6156 {
6257 type : GenkitMetric . ANSWER_ACCURACY ,
63- judge : gemini15Pro ,
58+ judge : googleAI . model ( 'gemini-2.5-pro' ) ,
6459 judgeConfig : PERMISSIVE_SAFETY_SETTINGS ,
6560 } ,
6661 ] ,
6762 } ) ,
6863 devLocalVectorstore ( [
6964 {
7065 indexName : 'pdfQA' ,
71- embedder : textEmbeddingGecko001 ,
66+ embedder : googleAI . embedder ( 'text-embedding-004' ) ,
7267 } ,
7368 ] ) ,
7469 langchain ( {
7570 evaluators : {
7671 criteria : [ 'coherence' ] ,
7772 labeledCriteria : [ 'correctness' ] ,
78- judge : gemini15Flash ,
73+ judge : googleAI . model ( 'gemini-2.5-pro' ) ,
7974 } ,
8075 } ) ,
8176 ] ,
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import {
1818 devLocalIndexerRef ,
1919 devLocalRetrieverRef ,
2020} from '@genkit-ai/dev-local-vectorstore' ;
21- import { gemini15Flash } from '@genkit-ai/googleai' ;
21+ import googleAI from '@genkit-ai/googleai' ;
2222import { z } from 'genkit' ;
2323import { EvalStatusEnum , type BaseEvalDataPoint } from 'genkit/evaluator' ;
2424import { Document } from 'genkit/retriever' ;
@@ -70,7 +70,7 @@ export const pdfQA = ai.defineFlow(
7070 context : docs . map ( ( d ) => d . text ) . join ( '\n\n' ) ,
7171 } ) ;
7272 const llmResponse = await ai . generate ( {
73- model : gemini15Flash ,
73+ model : googleAI . model ( 'gemini-2.5-flash' ) ,
7474 prompt : augmentedPrompt ,
7575 } ) ;
7676 return llmResponse . text ;
@@ -86,7 +86,7 @@ export const simpleStructured = ai.defineFlow(
8686 } ,
8787 async ( i ) => {
8888 const llmResponse = await ai . generate ( {
89- model : gemini15Flash ,
89+ model : googleAI . model ( 'gemini-2.5-flash' ) ,
9090 prompt : i . query ,
9191 } ) ;
9292 return { response : llmResponse . text } ;
@@ -102,7 +102,7 @@ export const simpleEcho = ai.defineFlow(
102102 } ,
103103 async ( i ) => {
104104 const llmResponse = await ai . generate ( {
105- model : gemini15Flash ,
105+ model : googleAI . model ( 'gemini-2.5-flash' ) ,
106106 prompt : i ,
107107 } ) ;
108108 return llmResponse . text ;
You can’t perform that action at this time.
0 commit comments