From 318200ec73af0a7fcc33c81160b3eb4ae6561042 Mon Sep 17 00:00:00 2001 From: samadpls Date: Wed, 20 Nov 2024 21:14:33 +0500 Subject: [PATCH] Update BestRAG and release versio: 0.2.1 --- bestrag/best_rag.py | 28 +++++++++++++++++++++++++++- requirements.txt | 2 +- setup.py | 11 +++-------- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/bestrag/best_rag.py b/bestrag/best_rag.py index 062a960..e7e9851 100644 --- a/bestrag/best_rag.py +++ b/bestrag/best_rag.py @@ -5,7 +5,7 @@ import uuid from typing import List, Optional from qdrant_client import QdrantClient, models -from qdrant_client.http.models import Distance, VectorParams +from qdrant_client.http.models import Distance from fastembed import TextEmbedding from fastembed.sparse.bm25 import Bm25 import PyPDF2 @@ -35,6 +35,8 @@ def __init__(self, late_interaction_model_name: Optional[str] = "BAAI/bge-small-en-v1.5" ): self.collection_name = collection_name + self.api_key = api_key + self.url = url self.client = QdrantClient(url=url, api_key=api_key) self.dense_model = TextEmbedding() @@ -225,3 +227,27 @@ def search(self, query: str, limit: int = 10): ) return results + + def __str__(self): + """ + Return a string representation of the BestRAG object, including its parameters + and a message to follow on GitHub. + """ + info = ( + "\033[94m" + "**************************************************\n" + "* BestRAG Object Information *\n" + "**************************************************\n" + f"* URL: {self.url}\n" + f"* API Key: {self.api_key}\n" + f"* Collection Name: {self.collection_name}\n" + "**************************************************\033[0m" + ) + message = ( + "\033[92m" + "**************************************************\n" + "* Made with ❤️ by samadpls *\n" + "* Visit: https://github.com/samadpls *\n" + "**************************************************\033[0m" + ) + return f"{info}\n{message}" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index eb6d6cd..0c17ede 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ fastembed==0.4.1 streamlit pytest flake8 -PyPDF2 +PyPDF2==3.0.1 qdrant-client onnxruntime==1.19.2 pytest \ No newline at end of file diff --git a/setup.py b/setup.py index 0a2f26c..84b3361 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,8 @@ setup( name="bestrag", - version="0.2.0", - description="BestRAG (Best Retrieval Augmented) is a library for storing and" - " searching document embeddings in a Qdrant vector database. It uses a " - "hybrid embedding technique combining dense, late interaction and sparse representations for better performance.", + version="0.2.1", + description="bestrag: Library for storing and searching document embeddings in a Qdrant vector database using hybrid embedding techniques.", author="samadpls", author_email="abdulsamadsid1@gmail.com", long_description=long_description, @@ -17,10 +15,7 @@ packages=find_packages(), install_requires=[ "fastembed==0.4.1", - "streamlit", - "pytest", - "flake8", - "PyPDF2", + "PyPDF2==3.0.1", "qdrant-client", "onnxruntime==1.19.2", ],