pub struct ProviderRule {Show 27 fields
pub model_match: String,
pub version_min: Option<Vec<u32>>,
pub native_tools: Option<bool>,
pub defer_loading: Option<bool>,
pub tool_search: Option<Vec<String>>,
pub max_tools: Option<u32>,
pub prompt_caching: Option<bool>,
pub vision: Option<bool>,
pub audio: Option<bool>,
pub pdf: Option<bool>,
pub files_api_supported: Option<bool>,
pub structured_output: Option<String>,
pub json_schema: Option<String>,
pub thinking_modes: Option<Vec<String>>,
pub interleaved_thinking_supported: Option<bool>,
pub anthropic_beta_features: Option<Vec<String>>,
pub thinking: Option<bool>,
pub vision_supported: Option<bool>,
pub preserve_thinking: Option<bool>,
pub server_parser: Option<String>,
pub honors_chat_template_kwargs: Option<bool>,
pub requires_completion_tokens: Option<bool>,
pub reasoning_effort_supported: Option<bool>,
pub reasoning_none_supported: Option<bool>,
pub recommended_endpoint: Option<String>,
pub text_tool_wire_format_supported: Option<bool>,
pub thinking_disable_directive: Option<String>,
}Expand description
One row of the capability matrix.
Fields§
§model_match: StringGlob pattern (supports leading / trailing * and a single mid-*).
Matched case-insensitively against the model ID.
version_min: Option<Vec<u32>>Optional [major, minor] lower bound. When set, the model ID
must parse via the provider’s version extractor AND compare ≥
this tuple. Rules with an unparseable version_min for the
given model are skipped, not merged.
native_tools: Option<bool>§defer_loading: Option<bool>§tool_search: Option<Vec<String>>§max_tools: Option<u32>§prompt_caching: Option<bool>§vision: Option<bool>Whether this provider/model route accepts image or other visual input blocks through Harn’s LLM message path.
audio: Option<bool>Whether this provider/model route accepts audio input blocks through Harn’s LLM message path.
pdf: Option<bool>Whether this provider/model route accepts PDF/document input blocks through Harn’s LLM message path.
files_api_supported: Option<bool>Whether uploaded file references can be reused in message content.
structured_output: Option<String>Structured-output transport strategy. Known values are:
native, tool_use, format_kw, and none.
json_schema: Option<String>Legacy name retained for project overrides written before
structured_output became the canonical capability.
thinking_modes: Option<Vec<String>>Supported thinking/reasoning modes for this rule. Values are
script-facing mode names: enabled, adaptive, and effort.
interleaved_thinking_supported: Option<bool>Whether Anthropic interleaved thinking is supported for this provider/model route.
anthropic_beta_features: Option<Vec<String>>Anthropic beta features that should be requested for this route.
thinking: Option<bool>Legacy override compatibility. New built-in rules should use
thinking_modes so the capability matrix preserves mode detail.
vision_supported: Option<bool>Whether the model accepts image inputs in chat content.
preserve_thinking: Option<bool>Carry <think>...</think> blocks in assistant history across turns.
Qwen3.6 exposes this as chat_template_kwargs.preserve_thinking;
Alibaba recommends enabling it for long-horizon agent loops so the
model doesn’t re-derive context it already worked out in prior turns.
Anthropic’s adaptive-thinking signature contract is stricter but plays
the same role there.
server_parser: Option<String>Name of any server-side response parser that can transform model
bytes before Harn sees them. none means the provider returns the
model text/tool channel without an implicit parser.
honors_chat_template_kwargs: Option<bool>Whether provider-specific chat_template_kwargs are honored.
Some OpenAI-compatible servers silently drop unknown kwargs.
requires_completion_tokens: Option<bool>Whether this route requires OpenAI’s max_completion_tokens
request field instead of legacy max_tokens.
reasoning_effort_supported: Option<bool>Whether this route accepts OpenAI’s reasoning_effort request field.
reasoning_none_supported: Option<bool>Whether this route accepts reasoning_effort: "none" as a true
reasoning-off setting. Older GPT-5 variants support effort but only
floor at minimal.
recommended_endpoint: Option<String>Preferred endpoint family for this provider/model route. Values
are descriptive labels consumed by providers, e.g.
/api/generate-raw for Ollama raw prompt bypass.
text_tool_wire_format_supported: Option<bool>Whether Harn’s text-tool protocol (<tool_call>name({...})) can
survive the provider route and return in the visible response body.
thinking_disable_directive: Option<String>In-prompt directive that disables this model’s “thinking” mode when
the API doesn’t expose a first-class field (or exposes it
inconsistently across templates / quantizations). For Qwen3 family
chat templates this is /no_think. When thinking: false is
requested and this is set, Harn auto-prepends the directive to the
system message so script authors don’t need to know it exists.
Trait Implementations§
Source§impl Clone for ProviderRule
impl Clone for ProviderRule
Source§fn clone(&self) -> ProviderRule
fn clone(&self) -> ProviderRule
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 ProviderRule
impl Debug for ProviderRule
Source§impl<'de> Deserialize<'de> for ProviderRule
impl<'de> Deserialize<'de> for ProviderRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProviderRule
impl RefUnwindSafe for ProviderRule
impl Send for ProviderRule
impl Sync for ProviderRule
impl Unpin for ProviderRule
impl UnsafeUnpin for ProviderRule
impl UnwindSafe for ProviderRule
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);