Configures the middleware, returning a MiddlewareRef for usage in generate({use: [...]}).
Optionalconfig: z.TypeOf<ConfigSchema>OptionalconfigAn optional Zod schema for validating the middleware's configuration.
OptionaldescriptionAn optional description of what the middleware does.
Factory function that receives the validated configuration and creates
a GenerateMiddlewareDef holding the active hooks.
OptionalmetadataMetadata describing this middleware.
The unique name of this middleware.
Optional plugin wrapper exposing this middleware for framework-level registration.
Generates a JSON-compatible representation of the middleware metadata.
Defines a Genkit Generate Middleware instance, which can be configured and registered. When invoked with an optional configuration, it returns a reference suitable for inclusion in a
GenerateOptions.usearray.