Skip to main content

Intelligence

Struct Intelligence 

Source
pub struct Intelligence {
Show 15 fields pub endpoints: Vec<String>, pub model: Option<String>, pub dialect: Option<String>, pub token: Option<Secret>, pub token_file: Option<String>, pub headers: BTreeMap<String, String>, pub auth: Option<Auth>, pub swap_policy: Option<String>, pub structured_output: StructuredOutput, pub budget: Budget, pub pricing: BTreeMap<String, Pricing>, pub timeout: Option<Dur>, pub models: BTreeMap<String, ModelTier>, pub default: Option<String>, pub preflight_model: Option<String>,
}

Fields§

§endpoints: Vec<String>§model: Option<String>§dialect: Option<String>

The wire dialect: openai (default), anthropic, or bedrock (native Amazon Bedrock Converse — pair with auth: {kind: aws, service: bedrock}). Unset ⇒ OpenAI-compatible.

§token: Option<Secret>§token_file: Option<String>§headers: BTreeMap<String, String>§auth: Option<Auth>

A unified credential provider for the LLM endpoint — e.g. oauth2 device-login for an enterprise gateway. Obtained via agentd login intelligence; the resolved bearer overrides token.

§swap_policy: Option<String>§structured_output: StructuredOutput§budget: Budget§pricing: BTreeMap<String, Pricing>§timeout: Option<Dur>§models: BTreeMap<String, ModelTier>

Named model TIERS. The model was one instance-global string, so choosing a cheap model for a classify step and a frontier one for a judgement call meant forking a subagent process just to change it — and the breaker was per ENDPOINT, so a frontier and a cheap model behind one gateway shared one breaker and one spend pool.

A tier is NOT a second service catalog: services: already names endpoints, auth, tags, rate and breaker, and restating those here would be a parallel mechanism. A tier points AT a service and may only narrow — it inherits that service’s trifecta tags and can never declare its own floor, so “make it cheaper” cannot quietly become a different security decision.

§default: Option<String>

Which tier is used when nothing names one. Falls back to model.

§preflight_model: Option<String>

The tier preflight runs on. Preflight is a recurring fixed cost on every inbound message, like compaction — it does not need the model that answers.

Implementations§

Source§

impl Intelligence

Source

pub fn wire_model(&self, reference: &str) -> String

Resolve a model reference to the wire model name.

A reference is either a declared TIER name or a literal model string, with the tier winning. That ordering is what lets models: be adopted without rewriting every place a model is already named — an existing literal keeps working, and a tier name takes over the moment one is declared under that name.

Source

pub fn tier(&self, reference: &str) -> Option<&ModelTier>

The tier a reference names, if it names one.

Source

pub fn default_reference(&self) -> Option<String>

The model reference used when nothing names one: default (a tier), else model (a literal or a tier name).

Source

pub fn fallback_chain(&self, reference: &str) -> Vec<String>

Walk the fallback chain from reference, stopping at the first tier with no fallback. Cycles are impossible because validation refuses them; the bound here is belt-and-braces for a config that reached the runtime some other way.

Source

pub fn timeout(&self) -> Duration

Source

pub fn endpoint_list(&self) -> Option<String>

The comma-joined endpoint list URI the v1 intelligence client speaks.

Trait Implementations§

Source§

impl Clone for Intelligence

Source§

fn clone(&self) -> Intelligence

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Intelligence

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Intelligence

Source§

fn default() -> Intelligence

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Intelligence

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Intelligence

Source§

fn eq(&self, other: &Intelligence) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Intelligence

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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, <T as TryFrom<U>>::Error>

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<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