generate method

Future<GenerateResult> generate(
  1. GenerateTurnState envelope,
  2. ActionFnArg<ModelResponseChunk, GenerateActionOptions, void> ctx,
  3. Future<GenerateResult> next(
    1. GenerateTurnState envelope,
    2. ActionFnArg<ModelResponseChunk, GenerateActionOptions, void> ctx
    )
)
inherited

Middleware for the top-level generate call.

Wraps the entire generation process, including the tool loop.

next is the function to call to proceed with the generation.

Implementation

Future<GenerateResult> generate(
  GenerateTurnState envelope,
  ActionFnArg<ModelResponseChunk, GenerateActionOptions, void> ctx,
  Future<GenerateResult> Function(
    GenerateTurnState envelope,
    ActionFnArg<ModelResponseChunk, GenerateActionOptions, void> ctx,
  )
  next,
) {
  return next(envelope, ctx);
}