pub struct ProviderSpec {
pub id: String,
pub kind: ProviderKind,
pub tiers: Vec<Tier>,
pub command: String,
pub args: Vec<String>,
pub model: Option<String>,
pub requires_env: Vec<String>,
pub timeout_seconds: Option<u64>,
pub prompt_on_stdin: bool,
pub usage_regex: Option<String>,
pub cost_per_1k_tokens: Option<f64>,
}Expand description
Every provider is a command template. {prompt}, {system}, {model}
and {tier} are substituted before spawn. This keeps BYOK support out of
the Rust build entirely: if you can invoke it from a shell, loopsmith can
route to it.
Fields§
§id: String§kind: ProviderKind§tiers: Vec<Tier>§command: String§args: Vec<String>§model: Option<String>§requires_env: Vec<String>Environment variables that must be present. Values are never read by loopsmith, only checked for presence, so keys stay out of the ledger.
timeout_seconds: Option<u64>§prompt_on_stdin: boolSend the prompt on stdin instead of substituting into args.
usage_regex: Option<String>Regex with one capture group pulling a token count out of the provider’s own output. Without it, usage is estimated from character count, which is enough to make a budget ceiling real but is not exact.
cost_per_1k_tokens: Option<f64>Price per thousand tokens, for the cost ceiling.
Trait Implementations§
Source§impl Clone for ProviderSpec
impl Clone for ProviderSpec
Source§fn clone(&self) -> ProviderSpec
fn clone(&self) -> ProviderSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderSpec
impl Debug for ProviderSpec
Source§impl<'de> Deserialize<'de> for ProviderSpec
impl<'de> Deserialize<'de> for ProviderSpec
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProviderSpec
impl RefUnwindSafe for ProviderSpec
impl Send for ProviderSpec
impl Sync for ProviderSpec
impl Unpin for ProviderSpec
impl UnsafeUnpin for ProviderSpec
impl UnwindSafe for ProviderSpec
Blanket Implementations§
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
Mutably borrows from an owned value. Read more