Skip to main content
The chat() method provides the simplest way to generate text responses. It returns just the text string, making it perfect for quick interactions.

Basic Usage

Method Signature

Parameters

Returns

A String containing the generated response text.

Throws

  • SDKError if the SDK is not initialized
  • SDKError if no LLM model is loaded
  • SDKError if generation fails

Examples

Simple Q&A

Conversation Flow

Error Handling

When to Use chat() vs generate()

SwiftUI Example

generate()

For detailed metrics and custom options, use generate() →