MCP PHP SDK

PromptMessage extends Content

Describes a message returned as part of a prompt.

Tags
phpstan-import-type

TextContentData from TextContent

phpstan-import-type

ImageContentData from ImageContent

phpstan-import-type

AudioContentData from AudioContent

phpstan-import-type

EmbeddedResourceData from EmbeddedResource

author

Kyrian Obikwelu koshnawaza@gmail.com

Table of Contents

Properties

$content  : TextContent|ImageContent|AudioContent|EmbeddedResource
$role  : Role
$type  : string

Methods

__construct()  : mixed
Create a new PromptMessage instance.
fromArray()  : self
jsonSerialize()  : EmbeddedResource}
Convert the message to an array.

Properties

Methods

fromArray()

public static fromArray(PromptMessageData $data) : self
Parameters
$data : PromptMessageData
Return values
self

jsonSerialize()

Convert the message to an array.

public jsonSerialize() : EmbeddedResource}
Return values
EmbeddedResource}

        
On this page

Search results