Find embedding providers
Gets information about embedding providers for automatic embedding generation, including supported providers, models, dimensions, and other 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
-
Python
-
TypeScript
-
Java
-
C#
-
curl
Returns a FindEmbeddingProvidersResult object that contains information about the the embedding providers.
The information in the response is arranged as a hierarchy of nested classes:
Returns a promise that resolves to a FindEmbeddingProvidersResult object that contains information about the the embedding providers.
The information in the response is arranged as a hierarchy of nested classes:
Returns a FindEmbeddingProvidersResult object that contains information about the the embedding providers.
This object wraps a map with provider names as keys and EmbeddingProvider objects as values.
Returns a FindEmbeddingProvidersResult, which is a dictionary with the embedding provider name as the keys, and EmbeddingProvider objects as the values.
Returns an object that contains information about the embedding providers.
Example response, truncated for brevity
{
"status": {
"embeddingProviders": {
"openai": {
"displayName": "OpenAI",
"url": "https://api.openai.com/v1/",
"supportedAuthentication": {
"SHARED_SECRET": {
"enabled": true,
"tokens": [
{
"accepted": "providerKey",
"forwarded": "Authorization"
}
]
},
# Truncated
},
"parameters": [
{
"name": "organizationId",
"type": "STRING",
"required": false,
"defaultValue": "",
"validation": {},
"help": "Optional, OpenAI Organization ID. If provided [...]",
"displayName": "Organization ID",
"hint": "Add an (optional) organization ID"
},
# Truncated
],
"models": [
{
"name": "text-embedding-3-small",
"vectorDimension": null,
"parameters": [
{
"name": "vectorDimension",
"type": "number",
"required": true,
"defaultValue": "1536",
"validation": {
"numericRange": [
2,
1536
]
},
"help": "Vector dimension to use in [...]"
}
]
},
# Truncated
]
},
# Truncated
}
}
}
Parameters
-
Python
-
TypeScript
-
Java
-
C#
-
curl
Use the find_embedding_providers method, which belongs to the AstraDBDatabaseAdmin class.
Method signature
find_embedding_providers(
*,
filter_model_status: str | ModelStatus,
database_admin_timeout_ms: int,
request_timeout_ms: int,
timeout_ms: int,
) -> FindEmbeddingProvidersResult
| 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 |
Use the findEmbeddingProviders method, which belongs to the DbAdmin class.
Method signature
async findEmbeddingProviders(
options?: {
filterModelStatus?: ModelLifecycleStatus | '',
timeout: number | TimeoutDescriptor,
}
): FindEmbeddingProvidersResult;
| Name | Type | Summary |
|---|---|---|
|
|
Optional.
The options for this operation.
See Properties of |
| Name | Type | Summary |
|---|---|---|
|
|
Optional. Filters the available models by status. Default: |
|
|
Optional. The client-side timeout for this operation. |
Use the findEmbeddingProviders method, which belongs to the com.datastax.astra.client.admin.DatabaseAdmin class.
Method signature
FindEmbeddingProvidersResult findEmbeddingProviders();
FindEmbeddingProvidersResult findEmbeddingProviders(FindEmbeddingProvidersOptions 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. |
Use the FindEmbeddingProvidersAsync method, which belongs to the IDatabaseAdmin class.
You can also use FindEmbeddingProviders, which is the synchronous version of the method.
Method signature
Task<FindEmbeddingProvidersResult> FindEmbeddingProvidersAsync(
FindEmbeddingProvidersOptions options = null
);
| Name | Type | Summary |
|---|---|---|
|
Optional.
Options for this operation.
For more information and examples for general options such as timeout, see Customize API interaction.
For options specific to this method, see Method-specific properties of the |
| Name | Type | Summary |
|---|---|---|
|
|
Optional. Filters the available models by status. Default: |
Use the findEmbeddingProviders Data API command.
The application token must have sufficient permissions to perform the requested operations, such as the Database Administrator role.
Command signature
curl -sS -L -X POST "API_ENDPOINT/api/json/v1" \
--header "Token: APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"findEmbeddingProviders": {
"options": {
"filterModelStatus": "STATUS"
}
}
}'
| Name | Type | Summary |
|---|---|---|
|
|
Optional.
Filters the available models by status.
Can be one of: Default: |
Examples
The following examples demonstrate how to find embedding providers.
-
Python
-
TypeScript
-
Java
-
C#
-
curl
from astrapy import DataAPIClient
client = DataAPIClient("APPLICATION_TOKEN")
admin = client.get_admin()
database_admin = admin.get_database_admin("API_ENDPOINT")
providers = database_admin.find_embedding_providers()
# Use the raw dict
print(providers.raw_info)
# Or work with the resulting object:
print(providers.embedding_providers.keys())
print(providers.embedding_providers["openai"])
print(providers.embedding_providers["openai"].parameters)
print(providers.embedding_providers["openai"].supported_authentication)
print(providers.embedding_providers["openai"].models[0])
print(providers.embedding_providers["openai"].models[0].parameters)
import { DataAPIClient } from "@datastax/astra-db-ts";
const client = new DataAPIClient("APPLICATION_TOKEN");
const admin = client.admin();
const databaseAdmin = admin.dbAdmin("API_ENDPOINT");
(async function () {
const providers = await databaseAdmin.findEmbeddingProviders();
console.log(JSON.stringify(providers));
})();
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.admin.DatabaseAdmin;
import com.datastax.astra.client.core.vectorize.EmbeddingProvider;
import com.datastax.astra.client.databases.Database;
import com.datastax.astra.client.databases.commands.results.FindEmbeddingProvidersResult;
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();
FindEmbeddingProvidersResult result = databaseAdmin.findEmbeddingProviders();
Map<String, EmbeddingProvider> providers = result.getEmbeddingProviders();
System.out.println(providers);
}
}
using DataStax.AstraDB.DataApi;
namespace Examples;
public class Program
{
static async Task Main()
{
// Get an existing database
var client = new DataAPIClient();
var database = client.GetDatabase(
"API_ENDPOINT",
"APPLICATION_TOKEN"
);
var databaseAdmin = database.GetAdmin();
var result = await databaseAdmin.FindEmbeddingProvidersAsync();
var providers = result.EmbeddingProviders;
}
}
curl -sS -L -X POST "API_ENDPOINT/api/json/v1" \
--header "Token: APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"findEmbeddingProviders": {
"options": {
"filterModelStatus": "SUPPORTED"
}
}
}'
Client reference
-
Python
-
TypeScript
-
Java
-
C#
-
curl
For more information, see the client reference.
For more information, see the client reference.
For more information, see the client reference.
For more information, see the client reference.
Client reference documentation is not applicable for HTTP.