PromptMessage extension type

Describes a message returned as part of a prompt.

This is similar to SamplingMessage, but also supports the embedding of resources from the MCP server.

on

Constructors

PromptMessage.new({required Role role, required List<Content> content})
factory
PromptMessage.fromMap(Map<String, Object?> _value)

Properties

content Content
The content of the message, see Content docs for the possible types.
no setter
role Role
The expected Role for this message in the prompt (multi-message prompt flows may outline a back and forth between users and assistants).
no setter