pub struct DefaultContextTranslation;Expand description
Default translation with built-in per-provider rules.
Current rules:
Content::Thinkingis kept as-is for Anthropic, converted toContent::Text(prefixed with[Reasoning]) for OpenAI variants, and dropped for other protocols.- All other content types pass through unchanged.
Trait Implementations§
Source§impl ContextTranslationStrategy for DefaultContextTranslation
impl ContextTranslationStrategy for DefaultContextTranslation
Source§fn translate_for_provider(
&self,
messages: &[Message],
target: ApiProtocol,
) -> Vec<Message>
fn translate_for_provider( &self, messages: &[Message], target: ApiProtocol, ) -> Vec<Message>
Translate a slice of messages for the given target provider protocol.
Auto Trait Implementations§
impl Freeze for DefaultContextTranslation
impl RefUnwindSafe for DefaultContextTranslation
impl Send for DefaultContextTranslation
impl Sync for DefaultContextTranslation
impl Unpin for DefaultContextTranslation
impl UnsafeUnpin for DefaultContextTranslation
impl UnwindSafe for DefaultContextTranslation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more