struct

ActionController::PromptMessage

Inherits YAML::Serializable < JSON::Serializable < Struct < Value < Object

a message returned by an MCP prompt, see ActionController::MCP

# starts a code review conversation
@[AC::MCP(prompt: true)]
def review(id : Int64) : Array(AC::PromptMessage)
  [
    AC::PromptMessage.user("Please review pull request #{id}"),
    AC::PromptMessage.assistant("Which aspects should I focus on?"),
  ]
end

Constructors

assistant(text : String) : PromptMessage
Source
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
new(pull : JSON::PullParser)
Source
new(text : String, role : Role = Role::User)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source
user(text : String) : PromptMessage
Source

Instance methods

role
Source
text
Source

Nested types