CURLOPT_PROXY option in the extension #16
-
I hope that the CURLOPT_PROXY option in the extension package can be freely configured, as some regions require IP proxies to access. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 When you instantiate your Guzzle client, you can set the 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 requests that you perform using I hope that helps, James |
Beta Was this translation helpful? Give feedback.
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:
And then instantiate the OpenAI client:
And then any re…