pub struct ModelConfig {
pub provider: Provider,
pub model: String,
pub endpoint: Option<String>,
pub api_key: Option<String>,
pub max_output_tokens: u32,
pub timeout_secs: u64,
pub max_retries: u32,
}Fields§
§provider: Provider§model: Stringe.g. “gpt-4o” or “llama3.1:8b”
endpoint: Option<String>Ollama base URL override; default http://localhost:11434
api_key: Option<String>OpenAI; read from OPENAI_API_KEY if None.
max_output_tokens: u32Default 4096.
timeout_secs: u64How long to wait for one response. There is no “off”: a request that waits forever is the most common way a program hangs.
max_retries: u32How many times to retry a request that failed for a reason that may not repeat: a refused connection, a timeout, a 429, a 5xx.
There is no “off” for the same reason http retries a GET: a provider
under load is the ordinary case, not the exceptional one, and a
program that gives up on the first 429 is a program that gives up
several times an hour.
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
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 moreAuto 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