AstraDB(
self,
*,
embedding: Embeddings,
collection_name: str,
token: | Name | Type | Description |
|---|---|---|
embedding* | Embeddings | embedding function to use. |
collection_name* | str | name of the Astra DB collection to create/use. |
token | Optional[str] | Default: NoneAPI token for Astra DB usage. |
api_endpoint | Optional[str] | Default: None |
astra_db_client | Optional[LibAstraDB] | Default: None |
async_astra_db_client | Optional[AsyncAstraDB] | Default: None |
namespace | Optional[str] | Default: None |
metric | Optional[str] | Default: None |
batch_size | Optional[int] | Default: None |
bulk_insert_batch_concurrency | Optional[int] | Default: None |
bulk_insert_overwrite_concurrency | Optional[int] | Default: None |
bulk_delete_concurrency | Optional[int] | Default: None |
pre_delete_collection | bool | Default: False |
| Name | Type |
|---|---|
| embedding | Embeddings |
| collection_name | str |
| token | Optional[str] |
| api_endpoint | Optional[str] |
| astra_db_client | Optional[LibAstraDB] |
| async_astra_db_client | Optional[AsyncAstraDB] |
| namespace | Optional[str] |
| metric | Optional[str] |
| batch_size | Optional[int] |
| bulk_insert_batch_concurrency | Optional[int] |
| bulk_insert_overwrite_concurrency | Optional[int] |
| bulk_delete_concurrency | Optional[int] |
| setup_mode | SetupMode |
| pre_delete_collection | bool |
Return docs most similar to embedding vector with score.
full URL to the API endpoint, such as
https://<DB-ID>-us-east1.apps.astra.datastax.com.
alternative to token+api_endpoint, you can pass an already-created 'astrapy.db.AstraDB' instance.
alternative to token+api_endpoint, you can pass an already-created 'astrapy.db.AsyncAstraDB' instance.
namespace (aka keyspace) where the collection is created. Defaults to the database's "default namespace".
similarity function to use out of those available in Astra DB. If left out, it will use Astra DB API's defaults (i.e. "cosine" - but, for performance reasons, "dot_product" is suggested if embeddings are normalized to one).
Size of batches for bulk insertions.
Number of threads or coroutines to insert batches concurrently.
Number of threads or coroutines in a batch to insert pre-existing entries.
Number of threads (for deleting multiple rows concurrently).
whether to delete the collection before creating it. If False and the collection already exists, the collection will be used as is.