CreateMessageRequest class

A request to create a message.

Annotations
  • @immutable

Constructors

CreateMessageRequest({required String role, required Object content, List<MessageAttachment>? attachments, Map<String, String>? metadata})
Creates a CreateMessageRequest.
const
CreateMessageRequest.fromJson(Map<String, dynamic> json)
Creates a CreateMessageRequest from JSON.
factory
CreateMessageRequest.user(Object content, {List<MessageAttachment>? attachments, Map<String, String>? metadata})
Creates a user message.
factory

Properties

attachments List<MessageAttachment>?
File attachments.
final
content Object
The content of the message.
final
hashCode int
The hash code for this object.
no setteroverride
metadata Map<String, String>?
Custom metadata.
final
role String
The role of the message author (must be "user").
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override