PromptValue class sealed

Represents the input to an LLM or Chat model.

When working with an LLM, the toString method will be used. When working with a Chat model, the toChatMessages method will be used.

Implementers
Annotations
  • @immutable

Constructors

PromptValue.chat(List<ChatMessage> messages)
A prompt template for chat models.
factory
PromptValue.string(String value)
Prompt value whose value is a string.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
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.
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.
toString() String
Returns a string representing the prompt.
override

Operators

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