Files
ds_zagres_ai/ai_service/config.py
T

35 lines
1.0 KiB
Python
Raw Normal View History

2025-05-09 15:41:16 +01:00
"""
Configuration settings for the AI service.
"""
import os
from dotenv import load_dotenv
# Load environment variables from .env file
2025-05-09 20:00:26 +01:00
import os.path
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
load_dotenv(dotenv_path=dotenv_path)
2025-05-09 15:41:16 +01:00
class Config:
"""Base configuration."""
# API configuration
API_HOST = os.environ.get('API_HOST', '0.0.0.0')
2025-05-09 20:00:26 +01:00
API_PORT = int(os.environ.get('API_PORT', 5252))
2025-05-09 15:41:16 +01:00
# OpenWebUI configuration
OPENWEBUI_URL = os.environ.get('OPENWEBUI_URL', 'http://104.225.217.215:8080')
OPENWEBUI_API_KEY = os.environ.get('OPENWEBUI_API_KEY', '')
# Ollama configuration
2025-05-12 16:10:45 +01:00
OLLAMA_API_URL = os.environ.get('OLLAMA_API_URL', 'http://127.0.0.1:11434')
2025-05-09 15:41:16 +01:00
DEFAULT_MODEL = os.environ.get('DEFAULT_MODEL', 'llama3.1')
2025-05-12 16:30:35 +01:00
API_TIMEOUT = int(os.environ.get('API_TIMEOUT', 300)) # Default timeout of 5 minutes (300 seconds)
2025-05-09 15:41:16 +01:00
# Document processing
CHUNK_SIZE = int(os.environ.get('CHUNK_SIZE', 1000))
CHUNK_OVERLAP = int(os.environ.get('CHUNK_OVERLAP', 200))
config = Config()