pub trait OAIPromptFormatter:
Send
+ Sync
+ 'static {
// Required methods
fn supports_add_generation_prompt(&self) -> bool;
fn render(&self, req: &dyn OAIChatLikeRequest) -> Result<String>;
// Provided method
fn image_placeholder_template(&self) -> Option<&'static str> { ... }
}Required Methods§
fn supports_add_generation_prompt(&self) -> bool
fn render(&self, req: &dyn OAIChatLikeRequest) -> Result<String>
Provided Methods§
Sourcefn image_placeholder_template(&self) -> Option<&'static str>
fn image_placeholder_template(&self) -> Option<&'static str>
Per-family image-placeholder template used when the chat template
requires string content and the request contains images. {n} in
the template is the 1-based image index. None when the
formatter has no flatten strategy — MM-aware routing falls back
to text-prefix routing for those families.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".