diff --git a/src/Anthropic/Platform/Anthropic.php b/src/Anthropic/Platform/Anthropic.php index ce405095..891823b6 100644 --- a/src/Anthropic/Platform/Anthropic.php +++ b/src/Anthropic/Platform/Anthropic.php @@ -16,7 +16,7 @@ public function __construct( HttpClientInterface $httpClient, - private string $apiKey, + #[\SensitiveParameter] private string $apiKey, ) { $this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient); } diff --git a/src/OpenAI/Platform/Azure.php b/src/OpenAI/Platform/Azure.php index 25a2d716..3b0a5f78 100644 --- a/src/OpenAI/Platform/Azure.php +++ b/src/OpenAI/Platform/Azure.php @@ -18,7 +18,7 @@ public function __construct( private string $baseUrl, private string $deployment, private string $apiVersion, - private string $key, + #[\SensitiveParameter] private string $apiKey, ) { $this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient); } @@ -29,7 +29,7 @@ protected function rawRequest(string $endpoint, array $body): ResponseInterface return $this->httpClient->request('POST', $url, [ 'headers' => [ - 'api-key' => $this->key, + 'api-key' => $this->apiKey, 'Content-Type' => 'application/json', ], 'query' => ['api-version' => $this->apiVersion], diff --git a/src/OpenAI/Platform/OpenAI.php b/src/OpenAI/Platform/OpenAI.php index 43280107..b3d4bfde 100644 --- a/src/OpenAI/Platform/OpenAI.php +++ b/src/OpenAI/Platform/OpenAI.php @@ -15,7 +15,7 @@ public function __construct( HttpClientInterface $httpClient, - private string $apiKey, + #[\SensitiveParameter] private string $apiKey, ) { $this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient); } diff --git a/src/Store/Azure/SearchStore.php b/src/Store/Azure/SearchStore.php index 6a1cb6c2..dfc5e77b 100644 --- a/src/Store/Azure/SearchStore.php +++ b/src/Store/Azure/SearchStore.php @@ -19,7 +19,7 @@ public function __construct( private HttpClientInterface $httpClient, private string $endpointUrl, - private string $apiKey, + #[\SensitiveParameter] private string $apiKey, private string $indexName, private string $apiVersion, private string $vectorFieldName = 'vector', diff --git a/src/Voyage/Platform/Voyage.php b/src/Voyage/Platform/Voyage.php index 6f03058e..b23dac28 100644 --- a/src/Voyage/Platform/Voyage.php +++ b/src/Voyage/Platform/Voyage.php @@ -11,7 +11,7 @@ { public function __construct( private HttpClientInterface $httpClient, - private string $apiKey, + #[\SensitiveParameter] private string $apiKey, ) { }