Class ResponseStreamIteratorWithHistory (1.24.0)

public class ResponseStreamIteratorWithHistory implements Iterator

Iterator of the ResponseStream that holds the response chunks.

Inheritance

java.lang.Object > ResponseStreamIteratorWithHistory

Implements

Iterator

Type Parameter

Name Description
GenerateContentResponse

Constructors

ResponseStreamIteratorWithHistory(Iterator serverStreamIterator)

public ResponseStreamIteratorWithHistory(Iterator serverStreamIterator)
Parameter
Name Description
serverStreamIterator Iterator

Methods

getHistory()

public List getHistory()

Retrieves 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