Find reranking providers (Python)
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 reranking providers.
The information in the response is arranged as a hierarchy of nested classes:
Signature
Use the find_reranking_providers method, which belongs to the AstraDBDatabaseAdmin class.
find_reranking_providers(
*,
filter_model_status: str | ModelStatus,
database_admin_timeout_ms: int,
request_timeout_ms: int,
timeout_ms: int,
) -> FindRerankingProvidersResult
Parameters
| Name | Type | Summary |
|---|---|---|
|
|
Optional. Filters the available models by status. Default: |
|
|
Optional.
A timeout, in milliseconds, to impose on the underlying API request.
If not provided, the This parameter is aliased as |
Examples
The following examples demonstrate how to find reranking providers.
from astrapy import DataAPIClient
client = DataAPIClient("APPLICATION_TOKEN")
admin = client.get_admin()
database_admin = admin.get_database_admin("API_ENDPOINT")
providers = database_admin.find_reranking_providers()
# Use the raw dict
print(providers.raw_info)
# Or work with the resulting object:
print(providers.reranking_providers.keys())
print(providers.reranking_providers["nvidia"])
print(providers.reranking_providers["nvidia"].models[0])
Errors
Specific error codes for this command include RERANKING_FEATURE_NOT_ENABLED.
For a full list of Data API error codes and their corresponding messages, see Data API errors and error codes.
For more information about how the client handles underlying Data API errors, see Python client error handling.
Client reference
For more information, see the client reference.