pub struct GeminiConfig {
pub api_key: Secret,
pub base_url: String,
}Expand description
Fields§
§api_key: SecretThe API key, redacted in Debug and in serialized form.
base_url: StringThe API root every wire builds its URI from.
Implementations§
Source§impl GeminiConfig
impl GeminiConfig
Sourcepub fn connect(self, http: impl HttpClientExt + 'static) -> Gemini
pub fn connect(self, http: impl HttpClientExt + 'static) -> Gemini
A client that sends this configuration’s requests through
http.
Source§impl GeminiConfig
impl GeminiConfig
Sourcepub fn new(api_key: impl Into<Secret>) -> Self
pub fn new(api_key: impl Into<Secret>) -> Self
The provider configured with api_key and the public base URL.
Sourcepub fn from_env() -> Result<Self, EnvError>
pub fn from_env() -> Result<Self, EnvError>
Load GEMINI_API_KEY, returning an error if it is missing or invalid.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Send to a different API root (a proxy, a regional endpoint).
Trait Implementations§
Source§impl Clone for GeminiConfig
impl Clone for GeminiConfig
Source§impl Debug for GeminiConfig
impl Debug for GeminiConfig
Source§impl<'de> Deserialize<'de> for GeminiConfig
impl<'de> Deserialize<'de> for GeminiConfig
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 PartialEq for GeminiConfig
impl PartialEq for GeminiConfig
Source§impl Serialize for GeminiConfig
impl Serialize for GeminiConfig
impl StructuralPartialEq for GeminiConfig
Auto Trait Implementations§
impl Freeze for GeminiConfig
impl RefUnwindSafe for GeminiConfig
impl Send for GeminiConfig
impl Sync for GeminiConfig
impl Unpin for GeminiConfig
impl UnsafeUnpin for GeminiConfig
impl UnwindSafe for GeminiConfig
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.