defineBidiFlow<Input, Output, Chunk, Init> method
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,
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;
}