| Name | Type | Description |
|---|---|---|
client* | Any | Rockset client object. |
query* | Any | Rockset query object. |
content_keys* | List[str] | The collection columns to be written into the |
metadata_keys | Optional[List[str]] | Default: None |
content_columns_joiner | Callable[[List[Tuple[str, Any]]], str] | Default: default_joiner |
Load from a Rockset database.
To use, you should have the rockset python package installed.
Example:
.. code-block:: python
# This code will load 3 records from the "langchain_demo"
# collection as Documents, with the `text` column used as
# the content
from langchain_community.document_loaders import RocksetLoader
from rockset import RocksetClient, Regions, models
loader = RocksetLoader(
RocksetClient(Regions.usw2a1, "<api key>"),
models.QueryRequestSql(
query="select * from langchain_demo limit 3"
),
["text"]
)
)
The collection columns to be written into the metadata of
the Documents. By default, this is all the keys in the document.
Method that joins content_keys and its values into a string. It's method that takes in a List[Tuple[str, Any]]], representing a list of tuples of (column name, column value). By default, this is a method that joins each column value with a new line. This method is only relevant if there are multiple content_keys.