MessagePrompt class final

All of the structured input text passed to the model as a prompt.

A MessagePrompt contains a structured set of fields that provide context for the conversation, examples of user input/model output message pairs that prime the model to respond in different ways, and the conversation history or list of messages representing the alternating turns of the conversation between the user and the model.

Inheritance
  • Object
  • ProtoMessage
  • MessagePrompt

Constructors

MessagePrompt({String context = '', List<Example> examples = const [], required List<Message> messages})
MessagePrompt.fromJson(Map<String, dynamic> json)
factory

Properties

context String
Optional. Text that should be provided to the model first to ground the response.
final
examples List<Example>
Optional. Examples of what the model should generate.
final
hashCode int
The hash code for this object.
no setterinherited
messages List<Message>
Required. A snapshot of the recent conversation history sorted chronologically.
final
qualifiedName String
The fully qualified name of this message, i.e., google.protobuf.Duration or google.rpc.ErrorInfo.
finalinherited
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() Object
override
toString() String
A string representation of this object.
override

Operators

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

Constants

fullyQualifiedName → const String