Skip to content

Commit 5d1ab29

Browse files
committed
feat: support skipping Genkit output validation
The output validation is useful, but it also could be considered flawing results of real model responses. e.g. if Gemini legitimately cuts off responses after the `class=` token.
1 parent 5520d4b commit 5d1ab29

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

runner/codegen/genkit/genkit-runner.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export class GenkitRunner implements LlmRunner {
8484
const result = await this._genkitRequest(provider, model, requestOptions);
8585
const files = result.output.outputFiles || [];
8686

87-
if (!provider.validateGeneratedFiles(files)) {
87+
if (
88+
process.env['WCS_SKIP_GENKIT_OUTPUT_VALIDATION'] !== '1' &&
89+
!provider.validateGeneratedFiles(files)
90+
) {
8891
throw new Error(`Invalid files generated by model "${options.model}"`);
8992
}
9093

0 commit comments

Comments
 (0)