client = new Client( new Psr18Client(), new Authentication(getenv('OPENAI_CLIENT_TEST_AUTH_TOKEN') ?: 'token'), (new MockUri())->base ); } public function testCreateMethod(): void { $create = $this->client->chatCompletions()->create(new CreateRequest([ 'model' => 'gpt-3.5-turbo', 'messages' => [['role' => 'system', 'content' => 'alpha0']], ])); $response = $create->getResponse(); $this->assertGreaterThanOrEqual(200, $response->getStatusCode()); $this->assertLessThan(300, $response->getStatusCode()); $model = $create->toModel(); $model->jsonSerialize(); $this->assertInstanceOf(CreateResponse::class, $model); } }