Adapter class

A model adapter for customizing language model behavior.

Create an adapter using Adapter.create or Adapter.fromAsset.

Example:

// From registered name
final adapter = await Adapter.create(name: 'my-adapter');

// From asset path
final adapter = await Adapter.fromAsset('assets/my-adapter.mlmodel');

final model = await SystemLanguageModel.create(adapter: adapter);

Properties

adapterId String
The internal adapter ID.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() Future<void>
Disposes the adapter and releases resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

create({required String name}) Future<Adapter>
Creates an adapter by name.
fromAsset(String assetPath) Future<Adapter>
Creates an adapter from a Flutter asset path.