Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

CURLOPT_PROXY option in the extension #16

Discussion options

You must be logged in to vote

Hi there @GitHub-Ahai,

The package allows you to use many different API clients, you can install any PSR-18 compatible HTTP client including Guzzle or the Symfony HTTP Client: https://tectalic.com/apis/openai/docs/php#system-requirements

And Guzzle supports configuring a proxy for all requests using the proxy option.

When you instantiate your Guzzle client, you can set the proxy configuration option:

eg:

  $httpClient = new \GuzzleHttp\Client([
        'proxy' => 'tcp://12.34.56.78:3128',
    ]);

And then instantiate the OpenAI client:

$auth = new \Tectalic\OpenAi\Authentication(getenv('OPENAI_API_KEY'));
$openaiClient = \Tectalic\OpenAi\Manager::build($httpClient, $auth);

And then any re…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GitHub-Ahai
Comment options

Answer selected by thejamescollins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants