ChatPromptValue class

Prompt value whose value is a list of messages.

When toString is called, it returns the string representation of the messages using the following format:

System: <system message>
Human: <human message>
AI: <AI message>
Human: <human message>
AI: <AI message>
...

When toChatMessages is called, it returns the list of messages.

Implemented types
Annotations
  • @immutable

Constructors

ChatPromptValue(List<ChatMessage> messages)
Prompt value whose value is a list of messages.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
messages List<ChatMessage>
List of messages to use as the prompt.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

concat(PromptValue other) PromptValue
Merges this prompt value with another by concatenating the content.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toChatMessages() List<ChatMessage>
Returns a list of messages representing the prompt.
override
toString() String
A string representation of this object.
override

Operators

operator ==(covariant ChatPromptValue other) bool
The equality operator.
override