| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 <?php 2 3 declare (strict_types=1); 4 namespace WordPress\AiClient\Messages\DTO; 5 6 use WordPress\AiClient\Messages\Enums\MessageRoleEnum; 7 /** 8 * Represents a message from the AI model. 9 * 10 * This is a convenience class that automatically sets the role to MODEL. 11 * Model messages contain the AI's responses. 12 * 13 * Important: Do not rely on `instanceof ModelMessage` to determine the message role. 14 * This is merely a helper class for construction. Always use `$message->getRole()` 15 * to check the role of a message. 16 * 17 * @since 0.1.0 18 */ 19 class ModelMessage extends \WordPress\AiClient\Messages\DTO\Message 20 { 21 /** 22 * Constructor. 23 * 24 * @since 0.1.0 25 * 26 * @param MessagePart[] $parts The parts that make up this message. 27 */ 28 public function __construct(array $parts) 29 { 30 parent::__construct(MessageRoleEnum::model(), $parts); 31 } 32 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Sat Jun 13 09:38:55 2026 | Cross-referenced by PHPXref |