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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff22847467e7ccbc5e9f2fc8e52d05431d7fc23d970fe867c5b8c89aa8c07d98 |
|
MD5 | 4cc56b3b92a70fafdd980b1378d0dd51 |
|
BLAKE2b-256 | 4324ef71fbba98fb015684d3b2f319634e3d00c35f07fe17fa82b36f58429592 |
Close
Hashes for llama_index_readers_singlestore-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e85c760a9cdbb7bbecb3332b930d1be411edaf8c59b56493b267c2b2c251bbc2 |
|
MD5 | 80e534536463b12144ed7789bd7ab2dd |
|
BLAKE2b-256 | ddca4a2f88b6a297506b8fb2294104767cbc34e8af889897e32092752b450ca5 |