Latest fixxes

This commit is contained in:
Iyeoluwa Akinrinola
2025-05-16 13:23:35 +01:00
parent f00941cece
commit e82861a5db
7 changed files with 709 additions and 13 deletions
+13 -5
View File
@@ -3,12 +3,15 @@ Configuration settings for the AI service.
"""
import os
from dotenv import load_dotenv
# Load environment variables from .env file
import os.path
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
load_dotenv(dotenv_path=dotenv_path)
# Try to load environment variables from .env file
try:
from dotenv import load_dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
load_dotenv(dotenv_path=dotenv_path)
except ImportError:
print("Warning: python-dotenv not installed. Using environment variables directly.")
class Config:
"""Base configuration."""
@@ -16,6 +19,7 @@ class Config:
# API configuration
API_HOST = os.environ.get('API_HOST', '0.0.0.0')
API_PORT = int(os.environ.get('API_PORT', 5252))
PUBLIC_URL = os.environ.get('PUBLIC_URL', '') # Public URL for webhooks
# OpenWebUI configuration
OPENWEBUI_URL = os.environ.get('OPENWEBUI_URL', 'http://104.225.217.215:8080')
@@ -30,5 +34,9 @@ class Config:
CHUNK_SIZE = int(os.environ.get('CHUNK_SIZE', 1000))
CHUNK_OVERLAP = int(os.environ.get('CHUNK_OVERLAP', 200))
# AI bot configuration
AI_TRIGGERS = os.environ.get('AI_TRIGGERS', '@ai,@bot,@assistant,@chatbot').split(',')
AI_RESPOND_TO_ALL = os.environ.get('AI_RESPOND_TO_ALL', 'false').lower() == 'true'
config = Config()