Add proxy support

Created on 31 January 2025, 3 days ago

Problem/Motivation

Sometimes we need to use proxy for OpenAI. OpenAI library supports it. Needs to add Drupal integration.

$client = \OpenAI::factory()
  ->withApiKey($this->apiKey)
  ->withHttpClient(new \GuzzleHttp\Client([
    'proxy' => 'socks5://USER:PASSWORD@ip:port',
  ]));

Proposed resolution

I think we can add "use proxy" checkbox and "proxy string" textfield for settings form.

And modify loadClient() function to use it if necessary.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

ivnish Kazakhstan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024