Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 4 additions & 24 deletions src/content/docs/docs/frameworks/nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,13 @@ The `--src-dir` flag creates a `src/` directory to keep your project organized b

Install the Genkit dependencies into your Next.js app:

1. Install the core Genkit library and the Next.js plugin:
1. Install the core Genkit library, the Next.js plugin, and at least one model plugin:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The phrase 'and at least one model plugin' could be confusing since the command that follows installs a specific one. To improve clarity, I suggest rephrasing to explicitly mention that @genkit-ai/google-genai is a unified plugin for both Google AI and Vertex AI. This will help users understand why they see tabs for both later in the document.

1.  Install the core Genkit library, the Next.js plugin, and the unified Google GenAI plugin (which supports both the Gemini API and Vertex AI):


```bash
npm install genkit @genkit-ai/next
npm install genkit @genkit-ai/next @genkit-ai/google-genai
```

2. Install at least one model plugin.

<Tabs syncKey="model-provider">
<TabItem label="Gemini (Google AI)">

```bash
npm install @genkit-ai/google-genai
```

</TabItem>
<TabItem label="Gemini (Vertex AI)">

```bash
npm install @genkit-ai/vertexai
```

</TabItem>

</Tabs>

3. Install the Genkit CLI globally. The tsx tool is also recommended as a development dependency, as it makes testing your code more convenient. Both of these dependencies are optional, however.
2. Install the Genkit CLI globally. The tsx tool is also recommended as a development dependency, as it makes testing your code more convenient. Both of these dependencies are optional, however.

```bash
npm install -g genkit-cli
Expand Down Expand Up @@ -127,7 +107,7 @@ For example, create `src/genkit/menuSuggestionFlow.ts`:
</TabItem>
<TabItem label="Gemini (Vertex AI)">
```ts
import { vertexAI } from '@genkit-ai/vertexai';
import { vertexAI } from '@genkit-ai/google-genai';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To avoid confusion for users who might wonder why vertexAI is being imported from @genkit-ai/google-genai under a 'Gemini (Vertex AI)' tab, it would be helpful to add a comment explaining that the @genkit-ai/google-genai package is a unified plugin that provides access to both Google AI and Vertex AI models.

    // The unified @genkit-ai/google-genai plugin provides access to both Google AI and Vertex AI.
    import { vertexAI } from '@genkit-ai/google-genai';

import { genkit, z } from 'genkit';

const ai = genkit({
Expand Down