# auto-alt-text/2.7.0/src/App/Configuration/OpenAIConfig.php

Auto Alt Text, version 2.7.0. 59 lines.

- Page: https://pluginprobe.com/plugins/auto-alt-text/2.7.0/code/src/App/Configuration/OpenAIConfig.php
- Raw: https://pluginprobe.com/plugins/auto-alt-text/2.7.0/raw/src/App/Configuration/OpenAIConfig.php
- Modified: 2026-01-14T13:38:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/auto-alt-text/2.7.0/code/src/App/Configuration/OpenAIConfig.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace AATXT\App\Configuration;

/**
 * Configuration object for OpenAI provider.
 *
 * Immutable value object that holds configuration data for OpenAI API calls.
 * This class implements the Dependency Injection pattern, removing the need
 * for static calls to PluginOptions.
 */
final class OpenAIConfig implements AIProviderConfig
{
    private string $apiKey;
    private string $prompt;
    private string $model;

    /**
     * @param string $apiKey The OpenAI API key
     * @param string $prompt The prompt template for generating alt text
     * @param string $model The OpenAI model identifier (e.g., 'gpt-4o', 'gpt-4o-mini')
     */
    public function __construct(
        string $apiKey,
        string $prompt,
        string $model
    ) {
        $this->model = $model;
        $this->prompt = $prompt;
        $this->apiKey = $apiKey;
    }

    /**
     * {@inheritDoc}
     */
    public function getApiKey(): string
    {
        return $this->apiKey;
    }

    /**
     * {@inheritDoc}
     */
    public function getPrompt(): string
    {
        return $this->prompt;
    }

    /**
     * {@inheritDoc}
     */
    public function getModel(): string
    {
        return $this->model;
    }
}

```
