collect()
The result from a streaming response, after it completes.
Declaration
nonisolated(nonsending) func collect() async throws -> sending LanguageModelSession.Response<Content>Discussion
If the streaming response was finished successfully before calling collect(), this method Response returns immediately.
If the streaming response was finished with an error before calling collect(), this method propagates that error.