AstraDBLoader(
self,
collection_name: str,
*,
token: str | TokenProvider| Name | Type | Description |
|---|---|---|
collection_name* | str | name of the Astra DB collection to use. |
token | str | TokenProvider | None | Default: NoneAPI token for Astra DB usage, either in the form of a string
or a subclass of |
api_endpoint | str | None | Default: Nonefull URL to the API endpoint, such as
|
environment | str | None | Default: None |
namespace | str | None | Default: None |
filter_criteria | dict[str, Any] | None | Default: None |
projection | dict[str, Any] | None | Default: _NOT_SET |
limit | int | None | Default: None |
nb_prefetched | int | Default: _NOT_SET |
page_content_mapper | Callable[[dict], str] | Default: json.dumps |
metadata_mapper | Callable[[dict], dict[str, Any]] | None | Default: None |
ext_callers | list[tuple[str | None, str | None] | str | None] | None | Default: None |
api_options | APIOptions | None | Default: None |
| Name | Type |
|---|---|
| collection_name | str |
| token | str | TokenProvider | None |
| api_endpoint | str | None |
| environment | str | None |
| namespace | str | None |
| filter_criteria | dict[str, Any] | None |
| projection | dict[str, Any] | None |
| limit | int | None |
| nb_prefetched | int |
| page_content_mapper | Callable[[dict], str] |
| metadata_mapper | Callable[[dict], dict[str, Any]] | None |
| ext_callers | list[tuple[str | None, str | None] | str | None] | None |
| api_options | APIOptions | None |
a string specifying the environment of the target Data API.
If omitted, defaults to "prod" (Astra DB production).
Other values are in astrapy.constants.Environment enum class.
namespace (aka keyspace) where the collection resides. If not provided, the environment variable ASTRA_DB_KEYSPACE is inspected. Defaults to the database's "default namespace".
Criteria to filter documents.
Specifies the fields to return. If not provided, reads fall back to the Data API default projection.
a maximum number of documents to return in the read query.
Max number of documents to pre-fetch. IGNORED starting from v. 0.3.5: astrapy v1.0+ does not support it.
Function applied to collection documents to create
the page_content of the LangChain Document. Defaults to json.dumps.
Function applied to collection documents to create the
metadata of the LangChain Document. Defaults to returning the
namespace, API endpoint and collection name.
one or more caller identities to identify Data API calls in the User-Agent header. This is a list of (name, version) pairs, or just strings if no version info is provided, which, if supplied, becomes the leading part of the User-Agent string in all API requests related to this component.
an instance of astrapy.utils.api_options.APIOptions that
can be supplied to customize the interaction with the Data API
regarding serialization/deserialization, timeouts, custom headers
and so on. The provided options are applied on top of settings already
tailored to this library, and if specified will take precedence.
Passing None (default) means no customization is requested.
Refer to the astrapy documentation for details.