Interface for loading data from URIs.
Implement this interface to load data (e.g., images, documents) from URIs for embedding. This is useful for multimodal scenarios where you want to store URIs in ChromaDB but load the actual content dynamically for embedding.
Example:
class ImageLoader implements DataLoader<List<String>> {
final http.Client client;
ImageLoader(this.client);
@override
Future<List<String>> call(List<String> uris) async {
final results = <String>[];
for (final uri in uris) {
final response = await client.get(Uri.parse(uri));
results.add(base64Encode(response.bodyBytes));
}
return results;
}
}
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
-
call(
List< String> uris) → Future<T> - Loads data from the given URIs.
-
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