respond(to:options:)
Produces a response to a prompt.
Declaration
@discardableResult nonisolated(nonsending) final func respond(to prompt: Prompt, options: GenerationOptions = GenerationOptions()) async throws -> LanguageModelSession.Response<String>Parameters
- prompt:
A prompt for the model to respond to.
- options:
GenerationOptions that control how tokens are sampled from the distribution the model produces.
Return Value
A string composed of the tokens produced by sampling model output.