Interface BidiAction.BidiHandler<I,O,S,Init>

Type Parameters:
I - per-turn input type
O - final output type
S - stream chunk type
Init - 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.

@FunctionalInterface public static interface BidiAction.BidiHandler<I,O,S,Init>
Functional interface that implements the bidirectional streaming logic.
  • Method Summary

    Modifier and Type
    Method
    Description
    handle(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 context
      init - the one-time session-init value; may be null
      inputs - the stream of per-turn inputs
      streamCallback - callback for emitting chunks
      Returns:
      the final output
      Throws:
      Exception - if handling fails