Class ResponseStream (1.24.0)

public class ResponseStream implements Iterable

An iterable of GenerateContentResponse.

Inheritance

java.lang.Object > ResponseStream

Implements

Iterable

Type Parameter

Name Description
GenerateContentResponse

Constructors

ResponseStream(ResponseStreamIteratorWithHistory iteratorWithHistory)

public ResponseStream(ResponseStreamIteratorWithHistory iteratorWithHistory)
Parameter
Name Description
iteratorWithHistory ResponseStreamIteratorWithHistory

Methods

isConsumed()

public boolean isConsumed()

Whether the content has been consumed.

"consumed" means all the content has been iterated through.

Returns
Type Description
boolean

iterator()

public Iterator iterator()
Returns
Type Description
Iterator<GenerateContentResponse>
Exceptions
Type Description
IllegalStateException

stream()

public Stream stream()

Makes a stream from the instance.

Returns
Type Description
Stream<GenerateContentResponse>