Skip to main content

ProviderConfig

Struct ProviderConfig 

Source
pub struct ProviderConfig {
Show 25 fields pub base_url: String, pub api_key: Option<String>, pub api_key_env: Option<String>, pub model: String, pub temperature: Option<f64>, pub timeout_secs: u64, pub stream: bool, pub max_retries: u32, pub retry_after_send: bool, pub retry_base_delay_ms: u64, pub context_budget_tokens: usize, pub max_tokens: Option<u32>, pub profile: Option<String>, pub top_p: Option<f64>, pub seed: Option<i64>, pub stop: Option<Vec<String>>, pub reasoning_effort: Option<String>, pub parallel_tool_calls: Option<bool>, pub vision: Option<bool>, pub tool_choice: Option<ToolChoice>, pub extra_body: Option<Value>, pub fallback: Option<Vec<String>>, pub aux: Option<String>, pub delegate: Option<String>, pub route: Vec<RouteConfig>,
}

Fields§

§base_url: String

Base URL of an OpenAI-compatible API, e.g. a local server. No default.

§api_key: Option<String>

Prefer api_key_env or ECLIPSE_API_KEY over storing a key here.

§api_key_env: Option<String>

Name of an environment variable holding the key.

§model: String§temperature: Option<f64>§timeout_secs: u64§stream: bool

Ask the endpoint for a token-by-token (SSE) reply. Endpoints that ignore the request and answer with plain JSON still work; set false to never ask.

§max_retries: u32

Extra attempts after a request fails with HTTP 408, 429 or 5xx, or could not be sent at all — refused, DNS, TLS (0 = never retry).

Waits retry_base_delay_ms, then double, then double again: 2 s, 4 s, 8 s with the defaults. Other 4xx statuses are never retried: a wrong key or a rejected option fails the same way every time. A failure that happened after the request went out — a reset mid-generation, a silent connection — is only repeated when retry_after_send says so, because repeating a billed request can pay for it twice.

§retry_after_send: bool

Repeat a request that failed after it went out — the connection dropped mid-generation, or nothing came back for timeout_secs. Off by default: /chat/completions is billed and not idempotent, so a repeat can pay for the same work twice, up to max_retries + 1 times a turn. A connect-stage failure (refused, DNS, TLS) never reached the server and is always repeated.

§retry_base_delay_ms: u64§context_budget_tokens: usize

Soft cap on the conversation sent to the model, in estimated tokens (characters / 4, a rough heuristic). When exceeded, the oldest turns are dropped and replaced by a marker note. 0 = disabled.

§max_tokens: Option<u32>

Cap on the reply, in tokens. Sent under the field name the profile asks for. None = do not send a cap.

§profile: Option<String>

Wire profile: openai (default), llamacpp, or one a plugin declares. Profiles change how the request is shaped, never what the model is asked.

§top_p: Option<f64>

Nucleus sampling. Unset = do not send. Most local servers default to 1.0 anyway; set this when a model rambles.

§seed: Option<i64>

Ask for a reproducible sample where the backend supports it. Unset = do not send.

§stop: Option<Vec<String>>

Up to four sequences the reply must stop at. Unset = do not send.

§reasoning_effort: Option<String>

low, medium or high on backends that have a reasoning knob. Unset = the route’s own declared default, which is medium on both shipped profiles, and nothing at all on a backend that declares no default (#276); a spelling this backend does not know comes back as a 400 naming the field.

§parallel_tool_calls: Option<bool>

Ask for several tool calls in one reply. Unset = do not send.

§vision: Option<bool>

Whether this route’s model can see images. Overrides the wire profile’s declaration: Some(true) enables vision on a profile that says nothing (such as llamacpp), Some(false) forces vision off even if a profile says true, and None inherits the profile.

§tool_choice: Option<ToolChoice>

auto, none, required, or a tool name. Overrides the profile’s default; unset leaves the profile’s own value (auto where the backend understands the field).

§extra_body: Option<Value>

JSON merged into every request body, after the config’s own fields and before a per-turn patch. The escape hatch for chat_template_kwargs and backend quirks this build does not model.

§fallback: Option<Vec<String>>

The order routes are tried in when a request fails for a transient reason. Only meaningful directly under [provider]; a route that carries one is a config error. Unset means “just the default route”, which is what a config without routes does.

§aux: Option<String>

The route that does the agent’s own housekeeping — the summary of trimmed turns — and never the user’s work. Only meaningful directly under [provider]; a route that carries one is a config error. Unset means “the route this run is on”.

§delegate: Option<String>

The route a delegate call’s child agent runs on unless the call names one. Only meaningful directly under [provider]; a route that carries one is a config error. Unset means “the route this run is on”.

§route: Vec<RouteConfig>

[[provider.route]]: named, complete provider configurations. Only meaningful directly under [provider].

Trait Implementations§

Source§

impl Clone for ProviderConfig

Source§

fn clone(&self) -> Self

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 ProviderConfig

Source§

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

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

impl Default for ProviderConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for ProviderConfig

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 ProviderConfig

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for ProviderConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ProviderConfig

Auto Trait Implementations§

§

impl Forget for ProviderConfig

§

impl Freeze for ProviderConfig

§

impl Move for ProviderConfig

§

impl RefUnwindSafe for ProviderConfig

§

impl Send for ProviderConfig
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for ProviderConfig
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for ProviderConfig
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for ProviderConfig

§

impl UnwindSafe for ProviderConfig
where RawVecInner: UnwindSafe, BTreeMap<String, Value>: UnwindSafe,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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, !>

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