Skip to content

Commit

Permalink
feature
Browse files Browse the repository at this point in the history
- update gemini client to support proxy
  • Loading branch information
nihao committed Dec 26, 2024
1 parent 8e6f197 commit d894a3c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rig-core/src/providers/gemini/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ impl Client {
}
}

pub fn with_proxy(mut self, proxy_url: &str) -> Self {
let proxy = reqwest::Proxy::all(proxy_url).expect("Proxy URL should be valid");
self.http_client = reqwest::Client::builder()
.proxy(proxy)
.build()
.expect("Gemini reqwest client should build");
self
}

/// Create a new Google Gemini client from the `GEMINI_API_KEY` environment variable.
/// Panics if the environment variable is not set.
pub fn from_env() -> Self {
Expand Down

0 comments on commit d894a3c

Please sign in to comment.