Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature - update gemini client to support proxy #169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nihao
Copy link

@nihao nihao commented Dec 26, 2024

  • update gemini client to support proxy
    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
    }

- update gemini client to support proxy
Copy link
Contributor

@0xMochan 0xMochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. Is there a specific reason proxy URLs should be used only with Gemini, shouldn't this be available globally? We generally try to avoid PRs without associated issues so it would be best if there was a feature request issue made that describes this feature and why it's neccessary!

@nihao
Copy link
Author

nihao commented Dec 29, 2024

Each provider has an independent Client, and I am currently only using Gemini. We can define a trait with a default implementation for with_proxy for all providers if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants