Find reranking providers (Java)
|
Hybrid search and reranking are currently in public preview. Development is ongoing, and the features and functionality are subject to change. Astra DB Serverless, and the use of such, is subject to the DataStax Preview Terms. |
Gets information about reranking providers for the find and rerank command, including supported providers, models, and configuration parameters.
Different databases might have different models available.
|
You need an application token with permission to interact with the target database, such as the Database Administrator role. For more information, see Get endpoint and token. |
Result
Returns a FindRerankingProvidersResult object that contains information about the the reranking providers.
The object contains a single attribute, rerankingProviders, which holds an untyped map with provider names as keys, and objects describing the provider as values.
Parameters
Use the findRerankingProviders method, which belongs to the com.datastax.astra.client.admin.DatabaseAdmin class.
Method signature
FindRerankingProvidersResult findRerankingProviders();
FindRerankingProvidersResult findRerankingProviders(FindRerankingProvidersOptions options);
| Name | Type | Summary |
|---|---|---|
|
|
Options for this command, including a filter for the available models by status. By default, the command returns only the supported models. |
Examples
The following examples demonstrate how to find reranking providers.
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.admin.DatabaseAdmin;
import com.datastax.astra.client.core.rerank.RerankProvider;
import com.datastax.astra.client.databases.Database;
import com.datastax.astra.client.databases.commands.results.FindRerankingProvidersResult;
import java.util.Map;
public class Example {
public static void main(String[] args) {
Database database = new DataAPIClient("APPLICATION_TOKEN").getDatabase("API_ENDPOINT");
DatabaseAdmin databaseAdmin = database.getDatabaseAdmin();
FindRerankingProvidersResult result = databaseAdmin.findRerankingProviders();
Map<String, RerankProvider> providers = result.getRerankingProviders();
System.out.println(providers);
}
}
Client reference
For more information, see the client reference.