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

Is it possible to use a Proxy-Server? #74

Closed
aurora opened this issue Jun 19, 2024 · 2 comments
Closed

Is it possible to use a Proxy-Server? #74

aurora opened this issue Jun 19, 2024 · 2 comments

Comments

@aurora
Copy link

aurora commented Jun 19, 2024

I wonder if there is an easy way to use a proxy server for connecting to the API. In Azure.AI.OpenAI, it is possible via HttpClientTransport in Azure.Core.Pipeline, and other libraries (such as Semantic Kernel) allow specifying a custom HttpClient instance. But I can't find a way to use a similar method with this library.

@trrwilson
Copy link
Collaborator

Hello, @aurora!

System.ClientModel has a very similar pipeline concept and you can supply a custom HttpClient/transport via the client options instance:

OpenAIClientOptions options = new()
{
    Transport = new HttpClientPipelineTransport(myHttpClient),
};
OpenAIClient client = new(options);

@aurora
Copy link
Author

aurora commented Jun 20, 2024

Hi @trrwilson,

Oh, I somehow overlooked this option. It works perfectly. Many thanks for your quick reply and help!

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

No branches or pull requests

3 participants