pub struct ModelConfig {
pub provider: String,
pub model: String,
pub max_output_tokens: u32,
pub max_run_tokens: u64,
pub cache_ttl: CacheTtl,
pub prices: Option<Prices>,
pub base_url: Option<String>,
pub api_key_env: Option<String>,
pub structured_native: bool,
}Expand description
The model speccoder calls.
Fields§
§provider: StringDriver name: anthropic or openai.
model: StringThe provider’s model id, pinned exactly.
max_output_tokens: u32Per-call output ceiling.
max_run_tokens: u64Token budget of one run.
cache_ttl: CacheTtlLifetime of prompt-cache breakpoints.
prices: Option<Prices>USD per million tokens, if configured (speccoder report --cost).
base_url: Option<String>openai-compatible: the server, e.g. http://localhost:11434/v1.
api_key_env: Option<String>openai-compatible: the environment variable holding a key, if the
server wants one.
structured_native: boolopenai-compatible: the server enforces json_schema output
(structured = "native", the default); "tool" carries it in a
forced tool instead, which works only for steps without tools.
Implementations§
Source§impl ModelConfig
impl ModelConfig
Sourcepub fn key_variable(&self) -> &str
pub fn key_variable(&self) -> &str
The environment variable holding this provider’s API key.
Sourcepub fn prompt_style(&self) -> PromptStyle
pub fn prompt_style(&self) -> PromptStyle
How prompts are laid out for this provider.
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§impl Debug for ModelConfig
impl Debug for ModelConfig
Source§impl PartialEq for ModelConfig
impl PartialEq for ModelConfig
impl StructuralPartialEq for ModelConfig
Auto Trait Implementations§
impl Freeze for ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnsafeUnpin for ModelConfig
impl UnwindSafe for ModelConfig
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