Skip to main content

ModelResolver

Type Alias ModelResolver 

Source
pub type ModelResolver<R> = Arc<dyn Fn(&CompletionResponse<R>) -> Option<String> + Send + Sync>;
Expand description

Caller-supplied resolver that pulls the actual model identifier out of a provider response. Useful for routed providers (OpenRouter, Bedrock model-routing, vendor multi-model endpoints) where the model recorded at hook construction is a logical alias and the response’s raw payload carries the concrete model that served the request.

When set and the resolver returns Some(model), that value is stamped on prompt.completed instead of TelemetryHookConfig::model.

Aliased Type§

pub struct ModelResolver<R> { /* private fields */ }