-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
requirements, server, lancedb and mongodb addition, some refactoring
- Loading branch information
1 parent
f696c38
commit db7f468
Showing
6 changed files
with
174 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,33 +93,33 @@ def query(self, query_text: str, similarity_top_k: int = 5): | |
|
||
return response | ||
|
||
def main(): | ||
OPENAI_API_KEY = "***" | ||
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY | ||
|
||
config = MongoDBConfig( | ||
connection_string="mongodb+srv://vipul:[email protected]/", | ||
db_name="movies", | ||
collection_name="movies_records", | ||
index_name="vector_index", | ||
) | ||
|
||
try: | ||
db_connector = MongoDBConnector(config) | ||
db_connector.connect() | ||
db_connector.verify_data() | ||
|
||
rag_engine = RAGEngine(db_connector) | ||
rag_engine.setup() | ||
|
||
query = "Any romantic movie for me? you can give anything you want?" | ||
rag_engine.query(query) | ||
|
||
except Exception as e: | ||
logger.error(f"An error occurred: {e}") | ||
finally: | ||
if 'db_connector' in locals(): | ||
db_connector.disconnect() | ||
|
||
if __name__ == "__main__": | ||
main() | ||
# def main(): | ||
# OPENAI_API_KEY = "***" | ||
# os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY | ||
|
||
# config = MongoDBConfig( | ||
# connection_string="**", | ||
# db_name="**", | ||
# collection_name="**", | ||
# index_name="**", | ||
# ) | ||
|
||
# try: | ||
# db_connector = MongoDBConnector(config) | ||
# db_connector.connect() | ||
# db_connector.verify_data() | ||
|
||
# rag_engine = RAGEngine(db_connector) | ||
# rag_engine.setup() | ||
|
||
# query = "Any romantic movie for me? you can give anything you want?" | ||
# rag_engine.query(query) | ||
|
||
# except Exception as e: | ||
# logger.error(f"An error occurred: {e}") | ||
# finally: | ||
# if 'db_connector' in locals(): | ||
# db_connector.disconnect() | ||
|
||
# if __name__ == "__main__": | ||
# main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,104 @@ | ||
# Web Framework and API | ||
fastapi==0.108.0 | ||
uvicorn==0.22.0 | ||
starlette==0.32.0.post1 | ||
|
||
# Data Validation and Settings Management | ||
pydantic==2.8.2 | ||
python-dotenv==1.0.0 | ||
|
||
# Async Libraries | ||
aiohttp==3.9.1 | ||
aiobotocore==2.9.0 | ||
aiofiles==23.2.1 | ||
aiohttp==3.9.1 | ||
azure-cognitiveservices-speech==1.38.0 | ||
daily-python==0.9.1 | ||
fastapi==0.108.0 | ||
fastembed==0.2.7 | ||
litellm==1.40.20 | ||
aiocsv==1.3.1 | ||
aiodynamo==23.10.1 | ||
aiohttp-retry==2.8.3 | ||
aioitertools==0.11.0 | ||
aiormq==6.8.0 | ||
aiosignal==1.3.1 | ||
|
||
# Database and Storage | ||
redis==5.0.1 | ||
pymongo==4.8.0 | ||
lancedb==0.10.2 | ||
SQLAlchemy==2.0.31 | ||
|
||
# Machine Learning and NLP | ||
numpy==1.26.1 | ||
scipy==1.11.4 | ||
scikit-learn==1.5.1 | ||
torch==2.1.2 | ||
torchaudio==2.1.2 | ||
transformers==4.39.3 | ||
sentence-transformers==3.0.1 | ||
fastembed==0.2.7 | ||
onnxruntime==1.18.1 | ||
nltk==3.8.1 | ||
|
||
# LLM and Related Libraries | ||
openai>=1.10.0 | ||
pydantic==2.8.2 | ||
litellm==1.40.20 | ||
llama-index==0.10.57 | ||
llama-index-vector-stores-lancedb==0.1.7 | ||
llama-index-vector-stores-mongodb==0.1.8 | ||
cohere==5.3.2 | ||
|
||
# Text Processing | ||
tiktoken>=0.6.0 | ||
tokenizers==0.15.2 | ||
|
||
# Audio Processing | ||
azure-cognitiveservices-speech==1.38.0 | ||
pydub==0.25.1 | ||
soundfile==0.12.1 | ||
|
||
# Date and Time Handling | ||
python-dateutil==2.8.2 | ||
python-dotenv==1.0.0 | ||
redis==5.0.1 | ||
pytz==2024.1 | ||
|
||
# HTTP and Networking | ||
requests==2.31.0 | ||
tiktoken>=0.6.0 | ||
twilio==8.9.0 | ||
uvicorn==0.22.0 | ||
httpx==0.25.2 | ||
websockets==10.4 | ||
onnxruntime>=1.16.3 | ||
scipy==1.11.4 | ||
|
||
# File Handling and Parsing | ||
python-multipart==0.0.6 | ||
Pillow==10.4.0 | ||
pypdf==4.3.1 | ||
|
||
# API Clients | ||
twilio==8.9.0 | ||
daily-python==0.9.1 | ||
slack_sdk==3.31.0 | ||
stripe==8.0.0 | ||
|
||
# Task Queue and Job Processing | ||
celery==5.3.6 | ||
taskiq==0.11.0 | ||
|
||
# Logging and Monitoring | ||
loguru==0.7.2 | ||
sentry-sdk==2.9.0 | ||
|
||
# Development and Testing | ||
uvloop==0.19.0 | ||
tokenizers | ||
huggingface-hub | ||
semantic-router | ||
sentence_transformers | ||
optimum[onnxruntime] | ||
llama-index | ||
llama-index-vector-stores-lancedb | ||
lancedb | ||
torchaudio | ||
python-multipart | ||
pytest==7.4.0 | ||
|
||
# Data Processing and Analysis | ||
pandas==2.2.2 | ||
pyarrow==15.0.0 | ||
|
||
# Utilities | ||
python-dateutil==2.8.2 | ||
tenacity==8.5.0 | ||
ratelimiter==1.2.0.post0 | ||
|
||
# Optional Dependencies (uncomment if needed) | ||
huggingface-hub==0.23.2 | ||
semantic-router==0.0.46 | ||
supabase==2.3.3 | ||
|
||
# Version Control (keep at the end) | ||
pip-compile==6.0.0 | ||
pip-tools==6.13.0 |