Struct LlmEnv
pub struct LlmEnv {
pub provider: Option<String>,
pub anthropic_key: Option<String>,
pub base_url: Option<String>,
pub api_key: Option<String>,
pub model: Option<String>,
}Expand description
Raw environment inputs for client resolution, read once at the crate’s only environment-touching site so that resolution itself stays pure.
Deliberately does NOT derive Debug: two fields carry API keys, and a
derived impl would print them through any {:?} or tracing sink.
Fields§
§provider: Option<String>CODELORE_LLM_PROVIDER — anthropic or openai-compat; unset lets the
presence of an Anthropic key (else the local default) decide.
anthropic_key: Option<String>ANTHROPIC_API_KEY — the Anthropic dialect’s credential.
base_url: Option<String>CODELORE_LLM_BASE_URL — the OpenAI-compatible endpoint base.
api_key: Option<String>CODELORE_LLM_API_KEY — optional bearer token for the OpenAI-compatible
endpoint.
model: Option<String>CODELORE_LLM_MODEL — required for the OpenAI-compatible dialect;
overrides the default Anthropic model when the Anthropic dialect is used.
Implementations§
§impl LlmEnv
impl LlmEnv
pub fn from_process_env() -> Self
pub fn from_process_env() -> Self
Read the LLM configuration from the process environment. Empty or whitespace-only values are treated as unset. This is the crate’s only environment-reading site.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LlmEnv
impl RefUnwindSafe for LlmEnv
impl Send for LlmEnv
impl Sync for LlmEnv
impl Unpin for LlmEnv
impl UnsafeUnpin for LlmEnv
impl UnwindSafe for LlmEnv
Blanket Implementations§
impl<T> Allocation for T
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more