ResponseStream
struct ResponseStream<Content, PartialContent> : AsyncSequenceAn asynchronous sequence of snapshots of the model’s response.
-
Declaration
Swift
public typealias Element = Snapshot -
A snapshot of the model’s response at a point in time.
Declaration
Swift
public struct Snapshot -
An iterator that provides snapshots of the model’s response.
Declaration
Swift
public struct AsyncIterator : AsyncIteratorProtocol -
Declaration
Swift
public func makeAsyncIterator() -> AsyncIterator -
Collects the entire streamed response into a single
Response.Throws
AGenerationErrorif the model fails to generate a response.Declaration
Swift
public nonisolated(nonsending) func collect() async throws -> sending GenerativeModelSession.Response<Content>Return Value
The final
Responsecontaining the fully generated content.