Package com.google.genkit.core
Interface BidiAction.BidiHandler<I,O,S,Init>
- Type Parameters:
I- per-turn input typeO- final output typeS- stream chunk typeInit- session-init type
- Enclosing interface:
BidiAction<I,O, S, Init>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface that implements the bidirectional streaming logic.
-
Method Summary
Modifier and TypeMethodDescriptionhandle(ActionContext ctx, Init init, InputSource<I> inputs, Consumer<S> streamCallback) Handles one invocation of the bidirectional action.
-
Method Details
-
handle
O handle(ActionContext ctx, Init init, InputSource<I> inputs, Consumer<S> streamCallback) throws Exception Handles one invocation of the bidirectional action.- Parameters:
ctx- the action contextinit- the one-time session-init value; may benullinputs- the stream of per-turn inputsstreamCallback- callback for emitting chunks- Returns:
- the final output
- Throws:
Exception- if handling fails
-