Skip to main content

MockCodec

Struct MockCodec 

Source
pub struct MockCodec;

Trait Implementations§

Source§

impl TextCodec for MockCodec

Source§

fn encode(&self, text: &str) -> Vec<u32>

Source§

fn token_bytes(&self, token: u32) -> Vec<u8> ⓘ

Source§

fn encode_content(&self, text: &str) -> Vec<u32>

Source§

fn encode_pieces(&self, pieces: &[(&str, bool)]) -> Vec<u32>

Source§

fn decode(&self, tokens: &[u32]) -> String

Source§

fn stream_prologue(&self) -> Vec<u32>

Source§

fn behavior_fingerprint(&self) -> Option<BehaviorFingerprint>

Source§

fn chat_template_source(&self) -> Option<String>

Source§

fn render_message(&self, _role: u32, _text: &str) -> Option<Vec<u32>>

Source§

fn generation_prefix(&self, _state: TurnState) -> Option<Vec<u32>>

Source§

fn trailing_generation_prompt( &self, _messages: &[ChatMessage], _tools: &[String], kwargs: &Map<String, Value>, span: &[u32], ) -> usize

Source§

fn empty_think_tokens(&self) -> Option<Vec<u32>>

Source§

fn generation_prefix_with( &self, state: TurnState, thinking: Option<bool>, ) -> Option<Vec<u32>>

Source§

fn render_system_full( &self, system: Option<&str>, tool_jsons: &[String], _kwargs: &Map<String, Value>, ) -> Option<Vec<u32>>

Source§

fn supports_reasoning_effort(&self) -> bool

Source§

fn supports_enable_thinking(&self) -> bool

Source§

fn reasoning_effort_levels(&self) -> Vec<&'static str>

Source§

fn validate_template_kwargs( &self, _kwargs: &Map<String, Value>, ) -> Result<(), String>

Source§

fn render_prompt_structured_with( &self, messages: &[ChatMessage], tools: &[String], _kwargs: &Map<String, Value>, ) -> Option<Vec<u32>>

Source§

fn template_refusal( &self, _messages: &[ChatMessage], _tools: &[String], _kwargs: &Map<String, Value>, ) -> Option<String>

Source§

fn turn_separator(&self) -> Option<Vec<u32>>

Source§

fn channel_markers(&self) -> Vec<(u32, u32, u32)>

Source§

fn render_system_with_tools( &self, _system: Option<&str>, _tool_jsons: &[String], ) -> Option<Vec<u32>>

Source§

fn render_tool_result(&self, _name: &str, _content: &str) -> Option<Vec<u32>>

Source§

fn render_assistant_with_tool_calls( &self, _content: &str, _calls: &[(String, String)], ) -> Option<Vec<u32>>

Source§

fn render_assistant_with_tool_calls_after_query( &self, content: &str, calls: &[(String, String)], ) -> Option<Vec<u32>>

The same turn where no user query follows it in the conversation (a step of a tool loop): some templates render that turn differently from one a later query put in history (Qwen’s open its reasoning block).
Source§

fn render_fim( &self, _prefix: &str, _suffix: &str, _mode: u8, ) -> Option<Vec<u32>>

Source§

fn render_turn_with_tokens( &self, _role: u32, _pre_text: &str, _inner: &[u32], _post_text: &str, ) -> Option<Vec<u32>>

Source§

fn render_block(&self, role: u32, kind: u32, payload: &str) -> Option<Vec<u32>>

Source§

fn channelizer(&self) -> Box<dyn Channelizer>

Source§

fn turn_terminators(&self) -> Vec<u32>

Source§

fn render_prompt_structured( &self, messages: &[ChatMessage], tools: &[String], ) -> Option<Vec<u32>>

Source§

fn render_prompt( &self, messages: &[(u32, String)], tools: &[String], ) -> Option<Vec<u32>>

Source§

fn call_grammar(&self, tool_jsons: &[String]) -> Option<String>

Source§

fn renders_per_message(&self) -> bool

Source§

fn tool_envelope(&self) -> ToolEnvelope

Source§

fn tool_fragment_mode(&self) -> ToolFragmentMode

Source§

fn tool_call_delimiters(&self) -> Option<(String, String)>

Source§

fn marker_literal(&self, token: u32) -> String

Source§

fn structural_tag( &self, tool_jsons: &[String], at_least_one: bool, ) -> Option<String>

Source§

fn response_format_tag(&self, json_schema: &str) -> Option<String>

Source§

fn parse_tool_call(&self, raw: &str) -> Option<(String, String)>

Source§

fn parse_tool_call_with( &self, raw: &str, schemas: Option<&ToolSchemas>, ) -> Option<(String, String)>

Source§

fn named_tool_call(&self, raw: &str) -> Option<(String, String)>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more