diff --git a/src/Anthropic/Platform/Anthropic.php b/src/Anthropic/Platform/Anthropic.php index b2054003..ddfdb84d 100644 --- a/src/Anthropic/Platform/Anthropic.php +++ b/src/Anthropic/Platform/Anthropic.php @@ -17,6 +17,7 @@ public function __construct( HttpClientInterface $httpClient, #[\SensitiveParameter] private string $apiKey, + private string $version = '2023-06-01', ) { $this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient); } @@ -31,7 +32,7 @@ public function request(array $body): iterable $response = $this->httpClient->request('POST', 'https://api.anthropic.com/v1/messages', [ 'headers' => [ 'x-api-key' => $this->apiKey, - 'anthropic-version' => '2023-06-01', + 'anthropic-version' => $this->version, ], 'json' => $body, ]);