llama-index readers singlestore integration
Project description
SingleStore Loader
The SingleStore Loader retrieves a set of documents from a specified table in a SingleStore database. The user initializes the loader with database information and then provides a search embedding for retrieving similar documents.
Usage
Here's an example usage of the SingleStoreReader:
from llama_hub.singlestore import SingleStoreReader
# Initialize the reader with your SingleStore database credentials and other relevant details
reader = SingleStoreReader(
scheme="mysql",
host="localhost",
port="3306",
user="username",
password="password",
dbname="database_name",
table_name="table_name",
content_field="text",
vector_field="embedding",
)
# The search_embedding is an embedding representation of your query_vector.
# Example search_embedding:
# search_embedding=[0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]
search_embedding = [n1, n2, n3, ...]
# load_data fetches documents from your SingleStore database that are similar to the search_embedding.
# The top_k argument specifies the number of similar documents to fetch.
documents = reader.load_data(search_embedding=search_embedding, top_k=5)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for llama_index_readers_singlestore-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18267171114508eb7ebcd674db67cb75dbc00a8dd7ae7ad8c539303b1bcdbe5d |
|
MD5 | f15ff9f851ee5b6fd86f19ffec53152b |
|
BLAKE2b-256 | 4264211b5449a46b65a6dfc3d4bb533a188f063ec3d620a8bbdee0ec72709368 |
Close
Hashes for llama_index_readers_singlestore-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11268083414b46a3e8a3a57684ccef2b2f9a5f5e2b2208a55acdc42cca13033d |
|
MD5 | b14ce6617f80c98a7679786ab5566311 |
|
BLAKE2b-256 | 7f51b288778c4b6c224cf7d875c748d76f93b518f898a3e7c7d126ac69109fea |