CoreFiles by mySites.guru
UserMessage.php31 lines, 812 bytes, from wordpress-7.0-beta1.zip
Raw History Compare with 6.9-beta4
md5
c418ef1b6b7bc7bd2876fb7bc9ddf85e
sha1
909aee07fa0927957247f3030f28853a09f808a5
sha256
6c626969935adb006ea79b2f71143487103e99457e7b8ebce964e992a2edcba3
<?php

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

use WordPress\AiClient\Messages\Enums\MessageRoleEnum;
/**
 * Represents a message from a user.
 *
 * This is a convenience class that automatically sets the role to USER.
 *
 * Important: Do not rely on `instanceof UserMessage` 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 UserMessage 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::user(), $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.