Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions src/content/docs/docs/backend-frameworks/django.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Aside, FileTree, LinkButton } from '@astrojs/starlight/components';

In this tutorial, you'll build **Bargain Chef**, a standalone Genkit backend on Django that exposes a recipe-generating flow over HTTP. It uses two AI patterns Genkit simplifies: streaming structured output and tool calling.

The `genkit-plugin-django` package wires the flow into Django's async (ASGI) stack with a single decorator, exposing both a JSON endpoint and a Server-Sent Events stream so any client can consume the partial recipe as it arrives, no manual request parsing or streaming code required.
The `genkit-django` package wires the flow into Django's async (ASGI) stack with a single decorator, exposing both a JSON endpoint and a Server-Sent Events stream so any client can consume the partial recipe as it arrives, no manual request parsing or streaming code required.

## What you'll build

Expand Down Expand Up @@ -41,7 +41,7 @@ uv run python manage.py startapp recipes
### Install packages

```bash
uv add django django-cors-headers uvicorn genkit genkit-plugin-django genkit-plugin-google-genai
uv add django django-cors-headers uvicorn genkit genkit-django genkit-googleai
```

These packages include:
Expand All @@ -50,8 +50,8 @@ These packages include:
- **`django-cors-headers`**: CORS middleware. Lets browser frontends served from a different origin call the Genkit endpoint.
- **`uvicorn`**: ASGI server that runs Django with async support.
- **`genkit`**: Core Genkit SDK.
- **`genkit-plugin-django`**: Helper that exposes Genkit flows as Django views, including server-sent events for streaming.
- **`genkit-plugin-google-genai`**: Plugin that connects Genkit to Google's Gemini models.
- **`genkit-django`**: Helper that exposes Genkit flows as Django views, including server-sent events for streaming.
- **`genkit-googleai`**: Plugin that connects Genkit to Google's Gemini models.

Install the Genkit CLI, which enables Genkit testing and observability:

Expand Down Expand Up @@ -132,8 +132,8 @@ from typing import Literal
from pydantic import BaseModel, Field

from genkit import ActionRunContext, Genkit
from genkit.plugins.django import genkit_django_handler
from genkit.plugins.google_genai import GoogleAI
from genkit_django import genkit_django_handler
from genkit_googleai import GoogleAI

ai = Genkit(
plugins=[GoogleAI()],
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/docs/backend-frameworks/fastapi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ curl -sL cli.genkit.dev | bash
Then install the packages you need in your project:

```bash
uv add fastapi uvicorn genkit genkit-plugin-google-genai genkit-plugin-fastapi
uv add fastapi uvicorn genkit genkit-googleai genkit-fastapi
```

These packages include:

- **`fastapi`**: The async Python web framework that serves your endpoint.
- **`uvicorn`**: The ASGI server that runs your FastAPI app.
- **`genkit`**: Core Genkit SDK.
- **`genkit-plugin-google-genai`**: Plugin that connects Genkit to Google's Gemini models.
- **`genkit-plugin-fastapi`**: Serves Genkit flows as FastAPI endpoints, including streaming.
- **`genkit-googleai`**: Plugin that connects Genkit to Google's Gemini models.
- **`genkit-fastapi`**: Serves Genkit flows as FastAPI endpoints, including streaming.

### Configure a model API key

Expand Down Expand Up @@ -100,8 +100,8 @@ from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel, Field

from genkit import ActionRunContext, Genkit
from genkit.plugins.fastapi import genkit_fastapi_handler
from genkit.plugins.google_genai import GoogleAI
from genkit_fastapi import genkit_fastapi_handler
from genkit_googleai import GoogleAI

ai = Genkit(
plugins=[GoogleAI()],
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/docs/backend-frameworks/flask.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ curl -sL cli.genkit.dev | bash
Then install the packages you need in your project:

```bash
uv add "flask[async]" flask-cors genkit genkit-plugin-google-genai genkit-plugin-flask
uv add "flask[async]" flask-cors genkit genkit-googleai genkit-flask
```

These packages include:

- **`flask`**: The Flask web framework.
- **`genkit`**: Core Genkit SDK for Python.
- **`genkit-plugin-google-genai`**: Plugin that connects Genkit to Google's Gemini models.
- **`genkit-plugin-flask`**: Helper that exposes Genkit flows as Flask routes, including server-sent events for streaming.
- **`genkit-googleai`**: Plugin that connects Genkit to Google's Gemini models.
- **`genkit-flask`**: Helper that exposes Genkit flows as Flask routes, including server-sent events for streaming.

### Configure a model API key

Expand Down Expand Up @@ -91,8 +91,8 @@ from flask_cors import CORS
from pydantic import BaseModel, Field

from genkit import ActionRunContext, Genkit
from genkit.plugins.flask import genkit_flask_handler
from genkit.plugins.google_genai import GoogleAI
from genkit_flask import genkit_flask_handler
from genkit_googleai import GoogleAI

ai = Genkit(
plugins=[GoogleAI()],
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/docs/deployment/any-platform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ mkdir -p ~/tmp/genkit-fastapi-project
cd ~/tmp/genkit-fastapi-project

uv init
uv add genkit genkit-plugin-google-genai fastapi uvicorn
uv add genkit genkit-googleai fastapi uvicorn
```

## 2. Define a flow
Expand All @@ -564,7 +564,7 @@ Create `flows.py`:

```python title="flows.py"
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI

ai = Genkit(
plugins=[GoogleAI()],
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/docs/deployment/cloud-run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ cd genkit-cloudrun
uv init

# Add dependencies
uv add genkit genkit-plugin-google-genai fastapi uvicorn slowapi
uv add genkit genkit-googleai fastapi uvicorn slowapi
```

### Create your FastAPI application with Genkit
Expand All @@ -616,7 +616,7 @@ from fastapi import FastAPI, HTTPException
from pydantic import BaseModel, Field

from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI

# Initialize Genkit
ai = Genkit(
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/dotprompt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ genkit start -- go run .

```python
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI

ai = Genkit(
plugins=[GoogleAI()],
Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/docs/evaluation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ UI, located at `localhost:4000/evaluate`.

```python
from genkit import Genkit, Document
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI
from pydantic import BaseModel

# Initialize Genkit
Expand Down Expand Up @@ -1315,7 +1315,7 @@ Here's an example of a custom evaluator that uses an LLM to check for "delicious

```python
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI
from genkit.evaluator import (
BaseEvalDataPoint,
EvalFnResponse,
Expand Down Expand Up @@ -1380,7 +1380,7 @@ You can also run evaluations directly in your code using `ai.evaluate()`:
```python
import asyncio
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI
from genkit.evaluator import BaseEvalDataPoint, EvalResponse

ai = Genkit(plugins=[GoogleAI()])
Expand Down Expand Up @@ -1643,7 +1643,7 @@ questions.
```python
from pathlib import Path
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI
from pydantic import BaseModel, Field
import pypdf # uv add pypdf

Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/docs/flows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void main() {

```python
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI
from pydantic import BaseModel, Field

ai = Genkit(
Expand Down Expand Up @@ -1320,7 +1320,7 @@ call.

```python
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI
from pydantic import BaseModel, Field

ai = Genkit(
Expand Down Expand Up @@ -1562,7 +1562,7 @@ from fastapi import FastAPI
from pydantic import BaseModel, Field

from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI

# Initialize Genkit
ai = Genkit(
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/docs/integrations/anthropic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -896,19 +896,19 @@ print('Name: \${person.name}, Age: \${person.age}');

<Lang lang="python">

The `genkit-plugin-anthropic` package provides access to Anthropic's Claude models through the Genkit framework.
The `genkit-anthropic` package provides access to Anthropic's Claude models through the Genkit framework.

## Installation

```bash
uv add genkit-plugin-anthropic
uv add genkit-anthropic
```

## Configuration

```python
from genkit import Genkit
from genkit.plugins.anthropic import Anthropic, anthropic_name
from genkit_anthropic import Anthropic, anthropic_name

ai = Genkit(
plugins=[Anthropic()],
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/docs/integrations/deepseek.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ resp, err := genkit.Generate(ctx, g,

<Lang lang="python">

The `genkit-plugin-compat-oai` package handles integration for [DeepSeek](https://www.deepseek.com/) models, including the powerful V4-Pro model and the efficient V4-Flash model.
The `genkit-openai` package handles integration for [DeepSeek](https://www.deepseek.com/) models, including the powerful V4-Pro model and the efficient V4-Flash model.

:::note
The DeepSeek plugin is built on top of the OpenAI-compatible plugin architecture. It is pre-configured for DeepSeek's API endpoints.
Expand All @@ -184,7 +184,7 @@ The DeepSeek plugin is built on top of the OpenAI-compatible plugin architecture
## Installation

```bash
uv add genkit-plugin-compat-oai
uv add genkit-openai
```

## Configuration
Expand All @@ -193,7 +193,7 @@ To use this plugin, import `OpenAI` and specify it when you initialize Genkit:

```python
from genkit import Genkit
from genkit.plugins.compat_oai import OpenAI
from genkit_openai import OpenAI
import os

ai = Genkit(
Expand All @@ -220,7 +220,7 @@ Use the `openai_model()` helper to reference a DeepSeek model.

```python
from genkit import Genkit
from genkit.plugins.compat_oai import OpenAI, openai_model
from genkit_openai import OpenAI, openai_model
import os

ai = Genkit(
Expand Down Expand Up @@ -434,7 +434,7 @@ You can pass configuration options that are not defined in the plugin's custom c

```python
from genkit import Genkit
from genkit.plugins.compat_oai import OpenAI, openai_model
from genkit_openai import OpenAI, openai_model
import os

ai = Genkit(plugins=[OpenAI(base_url='https://api.deepseek.com/v1', api_key=os.getenv('DEEPSEEK_API_KEY'))])
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/docs/integrations/google-cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ If you want to locally run flows that use this plugin, you need the
## Installation

```bash
uv add genkit-plugin-google-cloud
uv add genkit-google-cloud
```

## Configuration
Expand All @@ -203,7 +203,7 @@ To enable exporting to Google Cloud Tracing and Monitoring, import
telemetry gets automatically exported.

```python
from genkit.plugins.google_cloud import add_gcp_telemetry
from genkit_google_cloud import add_gcp_telemetry
```

```python
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/docs/integrations/google-genai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ The following features documented in other languages are not yet fully supported

<Lang lang="python">

The `genkit-plugin-google-genai` package provides the `GoogleAI` plugin for accessing Google's generative AI models via the Google Gemini API using API key authentication.
The `genkit-googleai` package provides the `GoogleAI` plugin for accessing Google's generative AI models via the Google Gemini API using API key authentication.

The plugin supports a wide range of capabilities:

Expand All @@ -1528,14 +1528,14 @@ The plugin supports a wide range of capabilities:
## Installation

```bash
uv add genkit-plugin-google-genai
uv add genkit-googleai
```

## Configuration

```python
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI

ai = Genkit(
plugins=[GoogleAI()],
Expand Down Expand Up @@ -1589,7 +1589,7 @@ This is useful for multi-tenant apps or routing requests to different keys. Mode

```python
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI
from genkit_googleai import GoogleAI

ai = Genkit(
plugins=[GoogleAI()],
Expand Down Expand Up @@ -1787,7 +1787,7 @@ Veo models generate videos from text prompts using the background model pattern

```python
import asyncio
from genkit.plugins.google_genai import VeoVersion
from genkit_googleai import VeoVersion

# Start video generation (returns an Operation)
response = await ai.generate(
Expand Down
14 changes: 7 additions & 7 deletions src/content/docs/docs/integrations/ollama.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ For development, you can run Ollama on your development machine. Deployed apps u
## Installation

```bash
uv add genkit-plugin-ollama
uv add genkit-ollama
```

## Configuration
Expand All @@ -302,8 +302,8 @@ To use this plugin, import `Ollama` and specify it when you initialize Genkit:

```python
from genkit import Genkit
from genkit.plugins.ollama import Ollama, ollama_name
from genkit.plugins.ollama.models import ModelDefinition
from genkit_ollama import Ollama, ollama_name
from genkit_ollama.models import ModelDefinition

ai = Genkit(
plugins=[
Expand Down Expand Up @@ -343,8 +343,8 @@ This plugin doesn't statically export model references. Specify one of the model

```python
from genkit import Genkit
from genkit.plugins.ollama import Ollama, ollama_name
from genkit.plugins.ollama.models import ModelDefinition
from genkit_ollama import Ollama, ollama_name
from genkit_ollama.models import ModelDefinition

ai = Genkit(
plugins=[
Expand Down Expand Up @@ -388,8 +388,8 @@ The Ollama plugin supports embeddings, which can be used for similarity searches

```python
from genkit import Genkit
from genkit.plugins.ollama import Ollama
from genkit.plugins.ollama.embedders import EmbeddingDefinition
from genkit_ollama import Ollama
from genkit_ollama.embedders import EmbeddingDefinition

ai = Genkit(
plugins=[
Expand Down
Loading