Expand description
Language model middleware.
A middleware wraps a model: it may rewrite call options, wrap the
generate/stream calls, and override identity or supported URLs. Apply
with wrap_language_model; the first middleware in the list is the
outermost.
Modules§
- builtin
- Built-in middleware.
Structs§
- Middleware
Context - The model being wrapped and the kind of call.
Enums§
- Call
Kind - Which model method is being called.
Traits§
- Language
Model Middleware - Intercepts language model calls. Every method has a pass-through default.
Functions§
- wrap_
language_ model - Wraps
modelwithmiddleware; the first entry becomes the outermost layer. An empty list returnsmodelunchanged.
Type Aliases§
- Generate
Next - Continuation of a wrapped
do_generate. - Stream
Next - Continuation of a wrapped
do_stream.