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§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
Source§impl JsonSchema for ProviderSpec
impl JsonSchema for ProviderSpec
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto 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