ModelMetadata
- Since
- 0.1.0
- Source
wp-includes/php-ai-client/src/Providers/Models/DTO/ModelMetadata.php:28
Represents metadata about an AI model.
Description
This class contains information about a specific AI model, including its identifier, display name, supported capabilities, and configuration options.
Compatibility
- WordPress
- since 0.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in 2 of the 5 tracked releases, added in 0.1.0.
Properties · 4
$idstringprotected$namestringprotected$supportedCapabilitiesWordPress\AiClient\Providers\Models\DTO\list<CapabilityEnum>protected$supportedOptionsWordPress\AiClient\Providers\Models\DTO\list<SupportedOption>protected
Methods · 9
- __construct()Constructor.
- getId()Gets the model's unique identifier.
- getName()Gets the model's display name.
- getSupportedCapabilities()Gets the model's supported capabilities.
- getSupportedOptions()Gets the model's supported configuration options.
- getJsonSchema(){@inheritDoc}
- toArray(){@inheritDoc}
- fromArray(){@inheritDoc}
- __clone()Performs a deep clone of the model metadata.
Source code
class ModelMetadata extends AbstractDataTransferObject{ public const KEY_ID = 'id'; public const KEY_NAME = 'name'; public const KEY_SUPPORTED_CAPABILITIES = 'supportedCapabilities'; public const KEY_SUPPORTED_OPTIONS = 'supportedOptions'; /** * @var string The model's unique identifier. */ protected string $id; /** * @var string The model's display name. */ protected string $name; /** * @var list<CapabilityEnum> The model's supported capabilities. */ protected array $supportedCapabilities; /** * @var list<SupportedOption> The model's supported configuration options. */ protected array $supportedOptions; /** * Constructor. * * @since 0.1.0 * * @param string $id The model's unique identifier. * @param string $name The model's display name. * @param list<CapabilityEnum> $supportedCapabilities The model's supported capabilities. * @param list<SupportedOption> $supportedOptions The model's supported configuration options. * * @throws InvalidArgumentException If arrays are not lists. */ public function __construct(string $id, string $name, array $supportedCapabilities, array $supportedOptions) { if (!array_is_list($supportedCapabilities)) { throw new InvalidArgumentException('Supported capabilities must be a list array.'); } if (!array_is_list($supportedOptions)) { throw new InvalidArgumentException('Supported options must be a list array.'); } $this->id = $id; $this->name = $name; $this->supportedCapabilities = $supportedCapabilities; $this->supportedOptions = $supportedOptions; } /** * Gets the model's unique identifier. * * @since 0.1.0 * * @return string The model ID. */ public function getId(): string { return $this->id; } /** * Gets the model's display name. * * @since 0.1.0 * * @return string The model name. */ public function getName(): string { return $this->name; } /** * Gets the model's supported capabilities. * * @since 0.1.0 * * @return list<CapabilityEnum> The supported capabilities. */ public function getSupportedCapabilities(): array { return $this->supportedCapabilities; }Changelog
Introduced in 0.1.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/php-ai-client/src/Providers/Models/DTO/ModelMetadata.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.