HumanChatMessagePromptTemplate class final

A chat message prompt template for a HumanChatMessage (ChatMessageType.human).

Inheritance
Available Extensions
Annotations
  • @immutable

Constructors

HumanChatMessagePromptTemplate({required PromptTemplate prompt})
A chat message prompt template for a HumanChatMessage (ChatMessageType.human).
const
HumanChatMessagePromptTemplate.fromTemplate(String template, {PartialValues? partialVariables, bool validateTemplate = true})
Creates a HumanChatMessagePromptTemplate from a string template. It considers the prompt a HumanChatMessage.
factory

Properties

defaultOptions BaseLangChainOptions
The default options to use when invoking the Runnable.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
inputVariables Set<String>
Input variables of all the messages in the prompt template.
no setterinherited
partialVariables PartialValues?
Partial variables.
no setterinherited
prompt PromptTemplate
The prompt template for the message.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

batch(List<InputValues> inputs, {List<BaseLangChainOptions>? options}) Future<List<List<ChatMessage>>>
Batches the invocation of the Runnable on the given inputs.
inherited
bind(BaseLangChainOptions options) RunnableBinding<InputValues, BaseLangChainOptions, List<ChatMessage>>
Binds the Runnable to the given options.
inherited
close() → void
Cleans up any resources associated with it the Runnable.
inherited
copyWith({BasePromptTemplate? prompt}) StringMessagePromptTemplate
Return a new StringMessagePromptTemplate instance with the given values.
override
format([InputValues values = const {}]) ChatMessage
Format the prompt with the inputs.
override
formatMessages(InputValues values) List<ChatMessage>
Format the prompt with the inputs returning a list of messages.
inherited
getCompatibleOptions(RunnableOptions? options) BaseLangChainOptions?
Returns the given options if they are compatible with the Runnable, otherwise returns null.
inherited
invoke(InputValues input, {BaseLangChainOptions? options}) Future<List<ChatMessage>>
Format the prompt with the inputs returning a list of messages.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pipe<NewRunOutput extends Object?, NewCallOptions extends RunnableOptions>(Runnable<List<ChatMessage>, NewCallOptions, NewRunOutput> next) RunnableSequence<InputValues, NewRunOutput>
Pipes the output of this Runnable into another Runnable using a RunnableSequence.
inherited
stream(InputValues input, {BaseLangChainOptions? options}) Stream<List<ChatMessage>>
Streams the output of invoking the Runnable on the given input.
inherited
streamFromInputStream(Stream<InputValues> inputStream, {BaseLangChainOptions? options}) Stream<List<ChatMessage>>
Streams the output of invoking the Runnable on the given inputStream.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(covariant ChatMessagePromptTemplate other) bool
The equality operator.
inherited

Static Methods

fromTemplateFile(String templateFile, {PartialValues? partialVariables, bool validateTemplate = true}) Future<HumanChatMessagePromptTemplate>
Load a prompt from a file. It considers the prompt a HumanChatMessage.