Class ResponseStreamIteratorWithHistory<GenerateContentResponse> (0.6.0)

public class ResponseStreamIteratorWithHistory<GenerateContentResponse> implements Iterator<GenerateContentResponse>

Iterator of the ResponseStream that holds the response chunks.

Inheritance

java.lang.Object > ResponseStreamIteratorWithHistory<GenerateContentResponse>

Type Parameter

Name Description
GenerateContentResponse

Constructors

ResponseStreamIteratorWithHistory(Iterator serverStreamIterator)

public ResponseStreamIteratorWithHistory(Iterator serverStreamIterator)
Parameter
Name Description
serverStreamIterator Iterator

Methods

getHistory()

public List<GenerateContentResponse> getHistory()

Retrieve all the chunks in a stream of responses.

Returns
Type Description
List<GenerateContentResponse>

hasNext()

public boolean hasNext()
Returns
Type Description
boolean

isConsumed()

public boolean isConsumed()

Whether the whole stream has been consumed.

Here "consumed" means we have reached the end of the stream.

Returns
Type Description
boolean

next()

public GenerateContentResponse next()
Returns
Type Description
GenerateContentResponse