pub trait GenerationRequest: Send + Sync {
// Required methods
fn is_stream(&self) -> bool;
fn get_model(&self) -> Option<&str>;
fn extract_text_for_routing(&self) -> String;
// Provided methods
fn routing_tokens(&self) -> Option<&[i32]> { ... }
fn rid(&self) -> Option<&str> { ... }
}Expand description
Trait for unified access to generation request properties Implemented by ChatCompletionRequest, CompletionRequest, GenerateRequest, EmbeddingRequest, RerankRequest, and ResponsesRequest
Required Methods§
Sourcefn extract_text_for_routing(&self) -> String
fn extract_text_for_routing(&self) -> String
Extract text content for routing decisions
Provided Methods§
Sourcefn routing_tokens(&self) -> Option<&[i32]>
fn routing_tokens(&self) -> Option<&[i32]>
Token IDs for routing when the request is already tokenized. Some(_) routes on the token radix tree instead of the decimal-string rendering of the same IDs.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".