client icon indicating copy to clipboard operation
client copied to clipboard

fix: set false GuzzleClient ssl laravel local developer

Open fabiovige opened this issue 1 year ago • 3 comments

During local development laravel throws ssl error. So I chose to add via service provider the verify = false option when instantiating the GuzzleClient that way it will not verify the ssl during local development.

fabiovige avatar Mar 05 '23 12:03 fabiovige

Hi @fabiovige

Thank you for your suggestion.

Because we do have other requests to modify the client in one or the other way (#39 #46 #30) I think it's better to have a generic way to modify the client options instead of just adding an extra parameter for this specific purpose.

But we will take your requirement into consideration for the further development. If you find time to look into the other issues, a more generic solution is very welcome.

gehrisandro avatar Mar 05 '23 14:03 gehrisandro

Claro,

Irei analisar com mais calma.

Obrigado pelo retorno.

fabiovige avatar Mar 05 '23 15:03 fabiovige

@fabiovige Thank you.

And thanks to OpenAI is was able to understand your reply 😅

Translate to english: "Claro,

Irei analisar com mais calma.

Obrigado pelo retorno."

Sure, I will take a closer look. Thank you for the feedback.

gehrisandro avatar Mar 05 '23 15:03 gehrisandro

You can now use the newly introduce factory to customize the guzzle client:

$client = OpenAI::factory()
    ->withApiKey('<your-api-key>')
    ->withHttpClient(new \GuzzleHttp\Client(['verify' => false]))
    ->make();

gehrisandro avatar Mar 17 '23 19:03 gehrisandro