| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace AATXT\App\Configuration; |
| 6 |
|
| 7 |
/** |
| 8 |
* Configuration object for Anthropic Claude provider. |
| 9 |
* |
| 10 |
* Immutable value object that holds configuration data for Anthropic API calls. |
| 11 |
* This class implements the Dependency Injection pattern, removing the need |
| 12 |
* for static calls to PluginOptions. |
| 13 |
*/ |
| 14 |
final class AnthropicConfig implements AIProviderConfig |
| 15 |
{ |
| 16 |
private string $apiKey; |
| 17 |
private string $prompt; |
| 18 |
private string $model; |
| 19 |
|
| 20 |
/** |
| 21 |
* @param string $apiKey The Anthropic API key |
| 22 |
* @param string $prompt The prompt template for generating alt text |
| 23 |
* @param string $model The Anthropic model identifier (e.g., 'claude-3-5-haiku-20241022', 'claude-sonnet-4-20250514') |
| 24 |
*/ |
| 25 |
public function __construct( |
| 26 |
string $apiKey, |
| 27 |
string $prompt, |
| 28 |
string $model |
| 29 |
) { |
| 30 |
$this->model = $model; |
| 31 |
$this->prompt = $prompt; |
| 32 |
$this->apiKey = $apiKey; |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* {@inheritDoc} |
| 37 |
*/ |
| 38 |
public function getApiKey(): string |
| 39 |
{ |
| 40 |
return $this->apiKey; |
| 41 |
} |
| 42 |
|
| 43 |
/** |
| 44 |
* {@inheritDoc} |
| 45 |
*/ |
| 46 |
public function getPrompt(): string |
| 47 |
{ |
| 48 |
return $this->prompt; |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
* {@inheritDoc} |
| 53 |
*/ |
| 54 |
public function getModel(): string |
| 55 |
{ |
| 56 |
return $this->model; |
| 57 |
} |
| 58 |
} |
| 59 |
|