Contents

streamResponse(to:options:)

Produces a response stream to a prompt.

Declaration

final func streamResponse(to prompt: Prompt, options: GenerationOptions = GenerationOptions()) -> sending LanguageModelSession.ResponseStream<String>

Parameters

  • prompt:

    A specific prompt for the model to respond to.

  • options:

    GenerationOptions that control how tokens are sampled from the distribution the model produces.

Return Value

A response stream that produces aggregated tokens.

Discussion

See Also

Streaming a response