FakeEchoChatModel class

Fake Chat Model for testing. It just returns the content of the last message of the prompt or streams it char by char.

Inheritance

Constructors

FakeEchoChatModel({FakeEchoChatModelOptions defaultOptions = const FakeEchoChatModelOptions()})
Fake Chat Model for testing. It just returns the content of the last message of the prompt or streams it char by char.
const

Properties

defaultOptions FakeEchoChatModelOptions
The default options to use when invoking the Runnable.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
modelType String
Return type of language model.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

batch(List<PromptValue> inputs, {List<FakeEchoChatModelOptions>? options}) Future<List<ChatResult>>
Batches the invocation of the Runnable on the given inputs.
inherited
bind(FakeEchoChatModelOptions options) RunnableBinding<PromptValue, FakeEchoChatModelOptions, ChatResult>
Binds the Runnable to the given options.
inherited
call(List<ChatMessage> messages, {FakeEchoChatModelOptions? options}) Future<AIChatMessage>
Runs the chat model on the given messages and returns a chat message.
inherited
close() → void
Cleans up any resources associated with it the Runnable.
inherited
countTokens(PromptValue promptValue, {FakeEchoChatModelOptions? options}) Future<int>
Returns the number of tokens resulting from tokenize the given prompt.
inherited
getCompatibleOptions(RunnableOptions? options) FakeEchoChatModelOptions?
Returns the given options if they are compatible with the Runnable, otherwise returns null.
inherited
invoke(PromptValue input, {FakeEchoChatModelOptions? options}) Future<ChatResult>
Invokes the Runnable on the given input.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pipe<NewRunOutput extends Object?, NewCallOptions extends RunnableOptions>(Runnable<ChatResult, NewCallOptions, NewRunOutput> next) RunnableSequence<PromptValue, NewRunOutput>
Pipes the output of this Runnable into another Runnable using a RunnableSequence.
inherited
stream(PromptValue input, {FakeEchoChatModelOptions? options}) Stream<ChatResult>
Streams the output of invoking the Runnable on the given input.
override
streamFromInputStream(Stream<PromptValue> inputStream, {FakeEchoChatModelOptions? options}) Stream<ChatResult>
Streams the output of invoking the Runnable on the given inputStream.
inherited
tokenize(PromptValue promptValue, {ChatModelOptions? options}) Future<List<int>>
Tokenizes the given prompt using the encoding used by the language model.
override
toString() String
A string representation of this object.
inherited
withFallbacks(List<Runnable<PromptValue, RunnableOptions, ChatResult>> fallbacks) RunnableWithFallback<PromptValue, ChatResult>
Adds fallback runnables to be invoked if the primary runnable fails.
inherited

Operators

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