From e2cce347dea5edcc0b3f75f61f469c40cfd17025 Mon Sep 17 00:00:00 2001 From: charescape <53265646+charescape@users.noreply.github.com> Date: Sun, 29 Sep 2024 00:47:19 +0800 Subject: [PATCH] Avoid naming confusion of variables Make http $client different from openai $client variable names --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 67ac0797..5853b977 100644 --- a/README.md +++ b/README.md @@ -84,10 +84,10 @@ $client = OpenAI::factory() ->withOrganization('your-organization') // default: null ->withProject('Your Project') // default: null ->withBaseUri('openai.example.com/v1') // default: api.openai.com/v1 - ->withHttpClient($client = new \GuzzleHttp\Client([])) // default: HTTP client found using PSR-18 HTTP Client Discovery + ->withHttpClient($httpClient = new \GuzzleHttp\Client([])) // default: HTTP client found using PSR-18 HTTP Client Discovery ->withHttpHeader('X-My-Header', 'foo') ->withQueryParam('my-param', 'bar') - ->withStreamHandler(fn (RequestInterface $request): ResponseInterface => $client->send($request, [ + ->withStreamHandler(fn (RequestInterface $request): ResponseInterface => $httpClient->send($request, [ 'stream' => true // Allows to provide a custom stream handler for the http client. ])) ->make();