pub enum ToolCallFormat {
Qwen3Xml,
Qwen35XmlParam,
LlamaJson,
MistralJson,
None,
}Expand description
Tool-call output format used by a model family.
Selected from the model’s architecture string at request time. Parsing is stateless (free functions), so an enum + match is simpler than a trait.
Variants§
Qwen3Xml
Qwen3 XML: <tool_call>{"name":…,"arguments":…}</tool_call>
Qwen35XmlParam
Qwen3.5 XML parameter format:
<tool_call><function=NAME><parameter=KEY>value</parameter>…</function></tool_call>
LlamaJson
Llama 3.1+: <|python_tag|> prefix + JSON {"name":…,"parameters":…}
MistralJson
Mistral: [TOOL_CALLS] prefix + JSON array
None
Model does not support tool calling.
Implementations§
Source§impl ToolCallFormat
impl ToolCallFormat
Sourcepub fn from_architecture(arch: &ModelArchitecture) -> Self
pub fn from_architecture(arch: &ModelArchitecture) -> Self
Select the tool-call format from the model architecture.
Sourcepub fn from_architecture_str(arch: &str) -> Self
pub fn from_architecture_str(arch: &str) -> Self
Select the tool-call format from an architecture name string.
Sourcepub fn from_model_ref(model_ref: &str) -> Self
pub fn from_model_ref(model_ref: &str) -> Self
Infer the tool-call format from a model reference string (e.g. “qwen3.5-9b:main”).
Uses substring matching against known model family names. Falls back to None
if the model family cannot be determined from the name.
Trait Implementations§
Source§impl Clone for ToolCallFormat
impl Clone for ToolCallFormat
Source§fn clone(&self) -> ToolCallFormat
fn clone(&self) -> ToolCallFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolCallFormat
impl Debug for ToolCallFormat
Source§impl PartialEq for ToolCallFormat
impl PartialEq for ToolCallFormat
Source§fn eq(&self, other: &ToolCallFormat) -> bool
fn eq(&self, other: &ToolCallFormat) -> bool
self and other values to be equal, and is used by ==.impl Copy for ToolCallFormat
impl Eq for ToolCallFormat
impl StructuralPartialEq for ToolCallFormat
Auto Trait Implementations§
impl Freeze for ToolCallFormat
impl RefUnwindSafe for ToolCallFormat
impl Send for ToolCallFormat
impl Sync for ToolCallFormat
impl Unpin for ToolCallFormat
impl UnsafeUnpin for ToolCallFormat
impl UnwindSafe for ToolCallFormat
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request