[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/src/Messages/DTO/ -> MessagePart.php (summary)

(no description)

File Size: 266 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

MessagePart:: (12 methods):
  __construct()
  getChannel()
  getType()
  getThoughtSignature()
  getText()
  getFile()
  getFunctionCall()
  getFunctionResponse()
  getJsonSchema()
  toArray()
  fromArray()
  __clone()


Class: MessagePart  - X-Ref

Represents a part of a message.

Messages can contain multiple parts of different types, such as text, files,
function calls, etc. This DTO encapsulates one such part.

__construct($content, ?MessagePartChannelEnum $channel = null, ?string $thoughtSignature = null)   X-Ref
Constructor that accepts various content types and infers the message part type.

param: mixed $content The content of this message part.
param: MessagePartChannelEnum|null $channel The channel this part belongs to. Defaults to CONTENT.
param: string|null $thoughtSignature Optional thought signature for extended thinking.

getChannel()   X-Ref
Gets the channel this message part belongs to.

return: MessagePartChannelEnum The channel.

getType()   X-Ref
Gets the type of this message part.

return: MessagePartTypeEnum The type.

getThoughtSignature()   X-Ref
Gets the thought signature.

return: string|null The thought signature or null if not set.

getText()   X-Ref
Gets the text content.

return: string|null The text content or null if not a text part.

getFile()   X-Ref
Gets the file.

return: File|null The file or null if not a file part.

getFunctionCall()   X-Ref
Gets the function call.

return: FunctionCall|null The function call or null if not a function call part.

getFunctionResponse()   X-Ref
Gets the function response.

return: FunctionResponse|null The function response or null if not a function response part.

getJsonSchema()   X-Ref
{@inheritDoc}


toArray()   X-Ref
{@inheritDoc}

return: MessagePartArrayShape

fromArray(array $array)   X-Ref
{@inheritDoc}


__clone()   X-Ref
Performs a deep clone of the message part.

This method ensures that nested objects (file, function call, function response)
are cloned to prevent modifications to the cloned part from affecting the original.




Generated : Sat Jun 13 09:38:55 2026 Cross-referenced by PHPXref