PromptMessage extends Content
Describes a message returned as part of a prompt.
Tags
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
$content read-only
public
TextContent|ImageContent|AudioContent|EmbeddedResource
$content
$role read-only
public
Role
$role
$type read-only
public
string
$type
Methods
__construct()
Create a new PromptMessage instance.
public
__construct(Role $role, TextContent|ImageContent|AudioContent|EmbeddedResource $content) : mixed
Parameters
- $role : Role
-
The role of the message
- $content : TextContent|ImageContent|AudioContent|EmbeddedResource
-
The content of the message
fromArray()
public
static fromArray(PromptMessageData $data) : self
Parameters
- $data : PromptMessageData
Return values
selfjsonSerialize()
Convert the message to an array.
public
jsonSerialize() : EmbeddedResource}