agents library

Middleware for Genkit Dart that enables sub-agent delegation.

This builds on Genkit's experimental agent surface. Like package:genkit/experimental.dart, these APIs are NOT covered by semantic-versioning stability guarantees and may change or be removed in any MINOR release without a major version bump.

Classes

$AgentDelegationArtifact
An artifact reported back by a delegation tool.
$AgentDelegationResult
Output schema for a generated delegation tool.
$AgentsOptions
Configuration options for the agents middleware.
$AsyncContinueInput
Input for the continue_task tool when $AgentsOptions.async is set.
$AsyncDelegateInput
Input schema for a delegation tool when $AgentsOptions.async is set: the plain input plus the background flag.
$BackgroundTaskReport
A per-task entry returned by the check and wait background-task tools.
$BackgroundTasksInput
Input for the check and abort background-task tools: a list of task handles.
$BackgroundTasksResult
Output for the check and wait background-task tools.
$ContinueInput
Input for the continue_task tool.
$DelegateInput
Input schema for a generated delegation tool.
$WaitBackgroundTasksInput
Input for the wait background-task tool: the handle list plus a bound on how long to block and the join semantics.
AgentDelegationArtifact
An artifact reported back by a delegation tool.
AgentDelegationResult
Output schema for a generated delegation tool.
AgentsMiddleware
Middleware that enables delegating tasks to registered sub-agents.
AgentsOptions
Configuration options for the agents middleware.
AgentsPlugin
Plugin that registers the agents sub-agent delegation middleware.
AsyncContinueInput
Input for the continue_task tool when $AgentsOptions.async is set.
AsyncDelegateInput
Input schema for a delegation tool when $AgentsOptions.async is set: the plain input plus the background flag.
BackgroundTaskReport
A per-task entry returned by the check and wait background-task tools.
BackgroundTasksInput
Input for the check and abort background-task tools: a list of task handles.
BackgroundTasksResult
Output for the check and wait background-task tools.
ContinueInput
Input for the continue_task tool.
DelegateInput
Input schema for a generated delegation tool.
WaitBackgroundTasksInput
Input for the wait background-task tool: the handle list plus a bound on how long to block and the join semantics.

Functions

agents({required List<String> agents, String? toolPrefix, int? maxDelegations, int? historyLength, String? artifactStrategy, bool? async}) → GenerateMiddlewareRef<AgentsOptions>
Creates a middleware ref that enables sub-agent delegation.