defineBidiFlow<Input, Output, Chunk, Init> method

Flow<Input, Output, Chunk, Init> defineBidiFlow<Input, Output, Chunk, Init>({
  1. required String name,
  2. required BidiActionFn<Input, Output, Chunk, Init> fn,
  3. SchemanticType<Input>? inputSchema,
  4. SchemanticType<Output>? outputSchema,
  5. SchemanticType<Chunk>? streamSchema,
  6. SchemanticType<Init>? initSchema,
})

Defines a bi-directional Genkit flow.

Implementation

Flow<Input, Output, Chunk, Init> defineBidiFlow<Input, Output, Chunk, Init>({
  required String name,
  required BidiActionFn<Input, Output, Chunk, Init> fn,
  SchemanticType<Input>? inputSchema,
  SchemanticType<Output>? outputSchema,
  SchemanticType<Chunk>? streamSchema,
  SchemanticType<Init>? initSchema,
}) {
  final flow = Flow.bidi(
    name: name,
    fn: fn,
    inputSchema: inputSchema,
    outputSchema: outputSchema,
    streamSchema: streamSchema,
    initSchema: initSchema,
  );
  registry.register(flow);
  return flow;
}