Text Generator
High-level text generation facade for a single LanguageModel.
TextGenerator turns GenerationInput plus optional Output decoding into cold Flow-based calls. Use generate for one-shot responses and collect the returned flow with .first(). Use stream or streamResult when the caller wants incremental StreamEvent values or stream metadata.
Streaming has no default deadline. Set CallConfig.timeout or configure the underlying HTTP/on-device engine socket timeout so a silent SSE or local engine stream cannot wait forever.
Since
0.3.0-beta01
Functions
Cold flow: no model call starts until collected. Each collection reruns the generation from the beginning, so provider calls may incur cost or billing again. One-shot callers should collect exactly one value, usually with .first().
Cold flow: no model call starts until collected. Each collection reruns the generation from the beginning, including structured-output decoding, so provider calls may incur cost or billing again. One-shot callers should collect exactly one value, usually with .first().
Starts a text stream when collected.
Creates a replayable stream result with request/response metadata.