ReqLLM. Router. Request
(ReqLLM v1.26.0)
View Source
The normalized input for an application model router.
The request has two fields:
contextis the normalized conversation and tools.routing_contextis opaque application data for model selection.
ReqLLM passes routing_context unchanged and does not add derived values such
as the generation operation, streaming state, output schema, provider
credentials, generation options, or transport options. Applications that need
one of these values for routing must include it explicitly in
routing_context.
Summary
Functions
Builds a normalized router request.
Returns the Zoi schema for a normalized router request.
Types
@type routing_context() :: map()
Opaque application data used to select a model.
@type t() :: %ReqLLM.Router.Request{ context: ReqLLM.Context.t(), routing_context: routing_context() }
Functions
@spec new(ReqLLM.Context.prompt(), keyword()) :: {:ok, t()} | {:error, term()}
Builds a normalized router request.
@spec schema() :: Zoi.schema()
Returns the Zoi schema for a normalized router request.