Class ResponseStream<GenerateContentResponse> (1.15.0)

public class ResponseStream<GenerateContentResponse> implements Iterable<GenerateContentResponse>

An iterable of GenerateContentResponse.

Inheritance

java.lang.Object > ResponseStream<GenerateContentResponse>

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<GenerateContentResponse> iterator()
Returns
Type Description
Iterator<GenerateContentResponse>
Exceptions
Type Description
IllegalStateException

stream()

public Stream<GenerateContentResponse> stream()

Makes a stream from the instance.

Returns
Type Description
Stream<GenerateContentResponse>