Skip to main content

Text Generation

Genkit provides a simple, unified interface for generating text across all supported AI models. Use the generate() or generateText() functions to create AI-powered content.

Basic Usage

Generate text with a simple prompt:

Configuration Options

Basic Configuration

Control generation behavior with configuration options:

System Messages

Set the AI’s behavior and personality with system messages:

Multi-Turn Conversations

Build conversations by passing message history:

Using Flows

Wrap your generation logic in flows for better observability and deployment:

Model Providers

Genkit supports multiple AI providers with a unified interface:

Google AI (Gemini)

Anthropic (Claude)

Ollama (Local Models)

Multiple Providers

Next Steps