TalatMasood commited on
Commit
5bfdeda
·
1 Parent(s): 19d2d02

Updated with port and issue fixed

Browse files

uvicorn src.main:app --host 0.0.0.0 --port $PORT

config/__pycache__/config.cpython-312.pyc CHANGED
Binary files a/config/__pycache__/config.cpython-312.pyc and b/config/__pycache__/config.cpython-312.pyc differ
 
config/config.py CHANGED
@@ -34,6 +34,16 @@ class Settings:
34
  # Better for development purposes.
35
  return os.getenv('EMBEDDING_MODEL', 'all-MiniLM-L6-v2')
36
 
 
 
 
 
 
 
 
 
 
 
37
  # New Conversation Summarizer Settings
38
  SUMMARIZER_CONFIG = {
39
  # 'facebook/bart-large-cnn', for bigger and better model
@@ -49,9 +59,6 @@ class Settings:
49
  # Vector Store Configuration
50
  CHROMA_PATH = os.getenv('CHROMA_PATH', './chroma_db')
51
 
52
- # MongoDB Configuration
53
- MONGODB_URI = os.getenv('MONGODB_URI', 'mongodb://localhost:27017')
54
-
55
  # Feedback Configuration
56
  MAX_RATING = int(os.getenv('MAX_RATING', '5'))
57
 
 
34
  # Better for development purposes.
35
  return os.getenv('EMBEDDING_MODEL', 'all-MiniLM-L6-v2')
36
 
37
+ # MongoDB Configuration
38
+ # MONGODB_URI = os.getenv('MONGODB_URI', 'mongodb://localhost:27017')
39
+ @property
40
+ def MONGODB_URI(self):
41
+ if self.ENVIRONMENT == 'production':
42
+ # Better model for demos
43
+ return os.getenv('MONGODB_URI', 'mongodb+srv://talat:[email protected]/?retryWrites=true&w=majority&appName=Chatbot')
44
+ # Better for development purposes.
45
+ return os.getenv('MONGODB_URI', 'mongodb://localhost:27017')
46
+
47
  # New Conversation Summarizer Settings
48
  SUMMARIZER_CONFIG = {
49
  # 'facebook/bart-large-cnn', for bigger and better model
 
59
  # Vector Store Configuration
60
  CHROMA_PATH = os.getenv('CHROMA_PATH', './chroma_db')
61
 
 
 
 
62
  # Feedback Configuration
63
  MAX_RATING = int(os.getenv('MAX_RATING', '5'))
64
 
src/__pycache__/main.cpython-312.pyc CHANGED
Binary files a/src/__pycache__/main.cpython-312.pyc and b/src/__pycache__/main.cpython-312.pyc differ
 
src/main.py CHANGED
@@ -1,4 +1,5 @@
1
  # src/main.py
 
2
  from config.config import settings
3
  from src.utils.database_cleanup import perform_cleanup
4
  from fastapi.security import APIKeyHeader
@@ -706,6 +707,17 @@ async def health_check():
706
  """Health check endpoint"""
707
  return {"status": "healthy"}
708
 
 
709
  if __name__ == "__main__":
 
710
  import uvicorn
711
- uvicorn.run(app, host="0.0.0.0", port=8000)
 
 
 
 
 
 
 
 
 
 
1
  # src/main.py
2
+ import uvicorn
3
  from config.config import settings
4
  from src.utils.database_cleanup import perform_cleanup
5
  from fastapi.security import APIKeyHeader
 
707
  """Health check endpoint"""
708
  return {"status": "healthy"}
709
 
710
+
711
  if __name__ == "__main__":
712
+ import os
713
  import uvicorn
714
+ # Get port from environment variable or default to 8000
715
+ port = int(os.getenv("PORT", 8000))
716
+
717
+ # Run the application
718
+ uvicorn.run(
719
+ "src.main:app",
720
+ host="0.0.0.0",
721
+ port=port,
722
+ reload=False # Set to False for production
723
+ )
src/utils/__pycache__/conversation_summarizer.cpython-312.pyc CHANGED
Binary files a/src/utils/__pycache__/conversation_summarizer.cpython-312.pyc and b/src/utils/__pycache__/conversation_summarizer.cpython-312.pyc differ