Skip to content

Commit

Permalink
Update BestRAG and release versio: 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
samadpls committed Nov 20, 2024
1 parent 058cc8e commit 318200e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
28 changes: 27 additions & 1 deletion bestrag/best_rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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}"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fastembed==0.4.1
streamlit
pytest
flake8
PyPDF2
PyPDF2==3.0.1
qdrant-client
onnxruntime==1.19.2
pytest
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]",
long_description=long_description,
Expand All @@ -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",
],
Expand Down

0 comments on commit 318200e

Please sign in to comment.