Package com.google.genkit.core
Class Flow.StreamingFlowValue<O,S>
java.lang.Object
com.google.genkit.core.Flow.StreamingFlowValue<O,S>
- Type Parameters:
O- the output typeS- the stream chunk type
StreamingFlowValue represents either a streamed chunk or the final output of
a flow.
-
Constructor Summary
ConstructorsConstructorDescriptionStreamingFlowValue(boolean done, O output, S stream) Creates a new StreamingFlowValue. -
Method Summary
-
Constructor Details
-
StreamingFlowValue
Creates a new StreamingFlowValue.- Parameters:
done- true if this is the final outputoutput- the final output (valid if done is true)stream- the stream chunk (valid if done is false)
-
-
Method Details
-
isDone
public boolean isDone()Returns true if this is the final output.- Returns:
- true if done
-
getOutput
Returns the final output. Valid only if isDone() returns true.- Returns:
- the output
-
getStream
Returns the stream chunk. Valid only if isDone() returns false.- Returns:
- the stream chunk
-