Type bag that encapsulates all agent type parameters.
This interface bundles all the generic type parameters used throughout the agent system into a single configuration object. This pattern simplifies type signatures and makes it easier to add new type parameters without changing multiple function signatures.
The context schema type
The middleware array type
The structured response type when using responseFormat
The custom state schema type
The tuple of stream transformer factories registered at
createAgent({ streamTransformers }). Used to infer the shape of
run.extensions on the stream returned by
streamEvents(..., { version: "v3" }).
The combined tools type from agent and middleware
// Define a type configuration
type MyAgentTypes = AgentTypeConfig<
{ name: string; email: string }, // Response type
typeof MyStateSchema, // State schema
typeof MyContextSchema, // Context schema
typeof myMiddleware, // Middleware array
typeof myTools, // Tools array
typeof myStreamTransformers // Stream transformer factories
>;
// Use with ReactAgent
const agent: ReactAgent<MyAgentTypes> = createAgent({ ... });