pub struct OpenAiConfig {
pub api_key: String,
pub base_url: String,
pub model: String,
pub max_tokens: u32,
pub embedding_model: Option<String>,
pub reasoning_effort: Option<String>,
}Expand description
Configuration for OpenAiProvider.
Pass to OpenAiProvider::new instead of individual positional arguments to avoid
silent parameter transposition.
§Examples
use zeph_llm::openai::{OpenAiConfig, OpenAiProvider};
let cfg = OpenAiConfig {
api_key: "sk-...".into(),
base_url: "https://api.openai.com/v1".into(),
model: "gpt-4o".into(),
max_tokens: 4096,
embedding_model: Some("text-embedding-3-small".into()),
reasoning_effort: None,
};
let provider = OpenAiProvider::new(cfg);Fields§
§api_key: StringSecret API key sent in the Authorization: Bearer header.
base_url: StringBase URL of the endpoint, e.g. "https://api.openai.com/v1".
Trailing slashes are stripped automatically.
model: StringChat model identifier, e.g. "gpt-4o".
max_tokens: u32Upper bound on completion tokens returned by the model.
embedding_model: Option<String>Embedding model identifier. Set to None when the endpoint does not support embeddings.
reasoning_effort: Option<String>Reasoning effort level for o* models ("low", "medium", or "high").
Leave None for standard chat models.
Trait Implementations§
Source§impl Clone for OpenAiConfig
impl Clone for OpenAiConfig
Source§fn clone(&self) -> OpenAiConfig
fn clone(&self) -> OpenAiConfig
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 OpenAiConfig
impl RefUnwindSafe for OpenAiConfig
impl Send for OpenAiConfig
impl Sync for OpenAiConfig
impl Unpin for OpenAiConfig
impl UnsafeUnpin for OpenAiConfig
impl UnwindSafe for OpenAiConfig
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