Skip to content

Commit 2a6524a

Browse files
authored
feat(cli): added dev:test-model cli command (#4064)
1 parent b9a9663 commit 2a6524a

File tree

6 files changed

+628
-2
lines changed

6 files changed

+628
-2
lines changed

bin/check_license

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ $HOME/go/bin/addlicense \
6363
-ignore '.trunk/**/*' \
6464
-ignore '**/*.toml' \
6565
-ignore '**/*.nix' \
66+
-ignore '**/*.yaml' \
6667
"$TOP_DIR"
6768

6869
uv run --directory "${PY_DIR}" liccheck

genkit-tools/cli/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@
3232
"dependencies": {
3333
"@genkit-ai/telemetry-server": "workspace:*",
3434
"@genkit-ai/tools-common": "workspace:*",
35+
"@inquirer/prompts": "^7.8.0",
3536
"@modelcontextprotocol/sdk": "^1.13.1",
3637
"axios": "^1.7.7",
3738
"colorette": "^2.0.20",
3839
"commander": "^11.1.0",
3940
"extract-zip": "^2.0.1",
4041
"get-port": "5.1.1",
41-
"@inquirer/prompts": "^7.8.0",
4242
"open": "^6.3.0",
4343
"ora": "^5.4.1",
44-
"semver": "^7.7.2"
44+
"semver": "^7.7.2",
45+
"yaml": "^2.8.0"
4546
},
4647
"devDependencies": {
4748
"@jest/globals": "^29.7.0",

genkit-tools/cli/src/cli.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
} from '@genkit-ai/tools-common/utils';
2424
import { Command, program } from 'commander';
2525
import { config } from './commands/config';
26+
import { devTestModel } from './commands/dev-test-model';
2627
import { evalExtractData } from './commands/eval-extract-data';
2728
import { evalFlow } from './commands/eval-flow';
2829
import { evalRun } from './commands/eval-run';
@@ -59,6 +60,7 @@ const commands: Command[] = [
5960
initAiTools,
6061
config,
6162
start,
63+
devTestModel,
6264
mcp,
6365
];
6466

genkit-tools/cli/src/commands/dev-test-model.ts

Lines changed: 545 additions & 0 deletions
Large diffs are not rendered by default.

genkit-tools/pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
- model: googleai/imagen-4.0-generate-001
2+
supports:
3+
- output-image
4+
- model: googleai/gemini-2.5-flash-preview-tts
5+
tests:
6+
- name: TTS Test
7+
input:
8+
messages:
9+
- role: user
10+
content:
11+
- text: 'Hello world'
12+
config:
13+
responseModalities: ['AUDIO']
14+
validators:
15+
- valid-media:audio
16+
- model: googleai/gemini-2.5-pro
17+
supports:
18+
- tool-request
19+
- structured-output
20+
- multiturn
21+
- system-role
22+
- input-image-base64
23+
- input-image-url
24+
- input-video-youtube
25+
- model: googleai/gemini-3-pro-preview
26+
supports:
27+
- tool-request
28+
- structured-output
29+
- multiturn
30+
- system-role
31+
- input-image-base64
32+
- input-image-url
33+
- input-video-youtube
34+
tests:
35+
- name: Tool Response Conformance
36+
input:
37+
messages:
38+
- role: user
39+
content:
40+
- text: 'What is the weather in New York? Use the tool.'
41+
- role: model
42+
content:
43+
- toolRequest:
44+
name: weather
45+
input:
46+
city: New York
47+
metadata:
48+
thoughtSignature: CvABAXLI2nxTZfKU3MkzLiGBrX62oq77vN2kHjT8pwwXRjtzbCqC07pPhIZ31sS+2kUFDh/kUY4SOvZzjjtP8UxI5GSFRWlX8yVDrDFo17RN/urwc1QuaMMzy66eQubpPRDEwfi6S5IKxZq0kRX6cSceB4NVCQAAAU8sYJwqWFL9CIaGac4lzF+34VvMWFLqdb40oe7/gw/KK1fqAeqDs+FJLksA+Q5qpHn3BETcqT0AuFe01IB2EVA7Us+/N3VGonw61F5cFNjHXO1jIYDybl3MXR9M5T5QB1a3EyicYXSX5/+bCmny1ka4kInbtzEqMMuv
49+
- role: tool
50+
content:
51+
- toolResponse:
52+
name: weather
53+
output: '21C'
54+
tools:
55+
- name: weather
56+
description: Get the weather for a city
57+
inputSchema:
58+
type: object
59+
properties:
60+
city:
61+
type: string
62+
required:
63+
- city
64+
validators:
65+
- text-includes:21
66+
- model: googleai/gemini-2.5-flash
67+
supports:
68+
- tool-request
69+
- structured-output
70+
- multiturn
71+
- system-role
72+
- input-image-base64
73+
- input-image-url
74+
- input-video-youtube

0 commit comments

Comments
 (0)