DeterministicEncoderProvider class final
A WayfinderEncoderProvider of DeterministicTestEmbedders.
Its encoders count an input's tokens as its space-separated words,
unless countTokens says otherwise, and accept maxTokens of them.
opened lists every embedder it opened, for a test to inspect.
- Implemented types
Constructors
-
DeterministicEncoderProvider({String model = DeterministicTestEmbedder.defaultModelName, int maxTokens = 512, Future<
int> countTokens(String text)?, DeterministicTestEmbedder create()?}) -
createbuilds each embedder, such as a subclass that fails; it must reportmodel.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- identity → WayfinderEncoderIdentity
-
What every encoder open returns reports, known without opening one.
no setteroverride
- maxTokens → int
-
The most tokens one input may have.
final
- model → String
-
The model name its embedders report.
final
-
opened
→ List<
DeterministicTestEmbedder> -
Every embedder open returned, oldest first.
final
- 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
-
open(
) → Future< WayfinderEncoder> -
Opens a new encoder, which the caller disposes. Throws a
WayfinderException with code
model-missingormodel-invalidwhen the model cannot be used.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited