Skip to content

Commit ee70e60

Browse files
authored
docs: refine .guides guidance a bit (#3683)
1 parent b0e82e1 commit ee70e60

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

js/genkit/.guides/setup.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { googleAI } from '@genkit-ai/google-genai';
1313

1414
export const ai = genkit({
1515
plugins: [googleAI()],
16+
model: googleAI.model('gemini-2.5-flash'),
1617
});
1718

1819
export { z };
@@ -26,5 +27,5 @@ import './genkit.js';
2627
// import each created flow, tool, etc. here for use in the Genkit Dev UI
2728
```
2829

29-
8. Add a `genkit:ui` script to `package.json` that runs `npx genkit-cli start -- npx tsx {sourceDir}/ai/index.ts` (or `pnpm dlx` or `yarn dlx` for those package managers). DO NOT try to run the script now.
30+
8. Add a `genkit:ui` script to `package.json` that runs `npx genkit-cli start -- npx tsx --watch {sourceDir}/ai/index.ts` (or `pnpm dlx` or `yarn dlx` for those package managers). DO NOT try to run the script now.
3031
9. Tell the user "Genkit is now configured and ready for use." as setup is now complete. Also remind them to set appropriate env variables (e.g. `GEMINI_API_KEY` for Google providers). Wait for the user to prompt further before creating any specific flows.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
To use a Gemini model with Genkit:
2+
3+
```ts
4+
import { ai, z } from '...'; // path to genkit instance
5+
import { googleAI } from '@genkit-ai/google-genai';
6+
7+
const { text } = await ai.generate({
8+
model: googleAI.model('gemini-2.5-flash'),
9+
prompt: '...',
10+
});
11+
```
12+
13+
ALWAYS use `gemini-2.5-*` series models, they are the best and current generation of Gemini models. NEVER use `gemini-2.0-*` or `gemini-1.5-*` models. For general purpose inference, use one of these models:
14+
15+
- `gemini-2.5-flash`: balance of speed/performance, good default
16+
- `gemini-2.5-pro`: most powerful, use for complex prompts
17+
- `gemini-2.5-flash-lite`: very fast, use for simple prompts
18+
19+
All of these models can accept multi-modal input, but for image or audio output see the available documentation for specialized models.

0 commit comments

Comments
 (0)