Skip to main content
Early Beta — The Web SDK is in early beta. APIs may change between releases.

Overview

The TextGeneration.generate() method with default options provides the simplest way to generate text. For a one-line approach, just pass a prompt and get a result.

Basic Usage

API Reference

Parameters

Returns

Throws

Examples

Simple Q&A

With Options

Error Handling

Simple vs Full Generation

For quick prototyping, use generate() with just a prompt. Switch to adding options when you need custom temperature, system prompts, or token limits.

Generate

Full generation with options and metrics

Streaming

Real-time token streaming