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
streamResponse(to:generating:includeSchemaInPrompt:options:)streamResponse(to:schema:includeSchemaInPrompt:options:)streamResponse(options:prompt:)streamResponse(generating:includeSchemaInPrompt:options:prompt:)streamResponse(schema:includeSchemaInPrompt:options:prompt:)LanguageModelSession.ResponseStreamGeneratedContentConvertibleFromGeneratedContentConvertibleToGeneratedContent