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

Support customizing the "verify" argument in requests. #139

Closed
wants to merge 1 commit into from

Conversation

q-x-iao
Copy link

@q-x-iao q-x-iao commented Sep 4, 2023

Hi! I'm working on a project that needs to use Anthropic APIs via a proxy. The current API has almost everything we need, but since the proxy uses a custom certificate we also need to change the verify argument. This pull requests adds that ability.

I see that _client.py is generated by Stainless, but I don't have access to it. Please let me know if I should move my changes to _client.py to somewhere else.

Thanks!

@rattrayalex
Copy link
Collaborator

rattrayalex commented Sep 4, 2023

Thank you for the feature request & the PR! We'll look into incorporating this.

In the meantime, if needed, you can work around this by setting a custom _client property, like so:

client = Anthropic()
client._client = httpx.Client(verify=False)

We also plan to expose better ways to provide a custom client.

@dgellow
Copy link

dgellow commented Oct 11, 2023

@rattrayalex will correct me if I'm wrong, but I believe a solution to pass a custom client has been implemented with #173. The change will be part of the next release.

Would that close this issue, once released?

@rattrayalex
Copy link
Collaborator

That's correct! Support for a custom http client has been released and you can now do:

client = Anthropic(http_client=httpx.Client(verify=False))

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.

3 participants