Chatoyant - v0.2.1
    Preparing search index...

    Function genStream

    • Stream text from an LLM in a single call.

      Parameters

      • prompt: string

        User prompt

      • Optionaloptions: GenStreamOptions

        Optional configuration

      Returns AsyncGenerator<string, void, undefined>

      Async generator of text chunks

      // Basic streaming
      for await (const chunk of genStream("Tell me a story")) {
      process.stdout.write(chunk);
      }

      // With options
      for await (const chunk of genStream("Write a poem", {
      system: "You are a poet",
      model: "claude-sonnet-4-20250514",
      })) {
      process.stdout.write(chunk);
      }