rerank method
Rerank documents based on query relevance
Implementation
Future<RerankerResult> rerank(
String query,
List<String> documents,
RerankConfig config,
) async {
try {
final result = await _channel.invokeMethod('rerank', {
'wrapperId': _wrapperId,
'query': query,
'documents': documents,
'config': config.toMap(),
});
return RerankerResult.fromMap(result as Map<String, dynamic>);
} on PlatformException catch (e) {
throw Exception('Failed to rerank: ${e.message}');
}
}