streamResponse(options:prompt:)
Produces a response stream to a prompt.
Declaration
final func streamResponse(options: GenerationOptions = GenerationOptions(), @PromptBuilder prompt: () throws -> Prompt) rethrows -> sending LanguageModelSession.ResponseStream<String>Parameters
- options:
GenerationOptions that control how tokens are sampled from the distribution the model produces.
- prompt:
A specific prompt for the model to respond to.
Return Value
A response stream that produces aggregated tokens.
Discussion
See Also
Streaming a response
streamResponse(to:options:)streamResponse(to:generating:includeSchemaInPrompt:options:)streamResponse(to:schema:includeSchemaInPrompt:options:)streamResponse(generating:includeSchemaInPrompt:options:prompt:)streamResponse(schema:includeSchemaInPrompt:options:prompt:)LanguageModelSession.ResponseStreamGeneratedContentConvertibleFromGeneratedContentConvertibleToGeneratedContent