CoreFiles by mySites.guru
ModelMessage.php32 lines, 868 bytes, from wordpress-7.1.zip
Raw History Compare with 7.0.8
md5
f27f9d19f830ed3fd816d325dfc5fe26
sha1
e7ac2fa35639088a7d9fa8b1cd2a4dbac0219fd6
sha256
f88592619e3d888838749fdf5973a1fb4f0bfe4939e81cbf52c25d9132b9b89e
<?php

declare (strict_types=1);
namespace WordPress\AiClient\Messages\DTO;

use WordPress\AiClient\Messages\Enums\MessageRoleEnum;
/**
 * Represents a message from the AI model.
 *
 * This is a convenience class that automatically sets the role to MODEL.
 * Model messages contain the AI's responses.
 *
 * Important: Do not rely on `instanceof ModelMessage` to determine the message role.
 * This is merely a helper class for construction. Always use `$message->getRole()`
 * to check the role of a message.
 *
 * @since 0.1.0
 */
class ModelMessage extends \WordPress\AiClient\Messages\DTO\Message
{
    /**
     * Constructor.
     *
     * @since 0.1.0
     *
     * @param MessagePart[] $parts The parts that make up this message.
     */
    public function __construct(array $parts)
    {
        parent::__construct(MessageRoleEnum::model(), $parts);
    }
}

The same content is in 40 releases, WordPress 7.0-beta1 to 7.2-beta5. See them all, or every version of this file.