mirror of
https://github.com/ION606/ML-pipeline.git
synced 2026-05-14 21:06:54 +00:00
67 lines
2.1 KiB
Python
67 lines
2.1 KiB
Python
import os
|
|
|
|
|
|
class Config:
|
|
# === System Architecture ===
|
|
USER_ID = "ION606"
|
|
LOG_DIR = "logs"
|
|
|
|
# === Code Execution ===
|
|
CODE_TIMEOUT = 15 # Seconds before killing process
|
|
CODE_MEMORY_LIMIT_MB = 100 # Memory limit for subprocesses
|
|
OUTPUT_CHAR_LIMIT = 2000 # Max characters for stdout/stderr
|
|
MAX_CODE_RETRIES = 3 # Max code fix attempts
|
|
CORE_DUMP_LIMIT = 0 # Disable core dumps
|
|
MAX_CODE_LENGTH = 10000 # Character limit for code inputs
|
|
|
|
# === Orchestration ===
|
|
MAX_ORCHESTRATION_ITERATIONS = 5 # Max loops in orchestrate()
|
|
SEARCH_CONTEXT_LIMIT = 3000 # Characters for web context
|
|
LOCAL_CONTEXT_ITEMS = 3 # File chunks to include
|
|
|
|
# === Text Processing ===
|
|
CHUNK_SIZE = 1000 # Document chunking size
|
|
CHUNK_OVERLAP = 200 # Document chunk overlap
|
|
RESPONSE_TOKEN_LIMIT = 4096 # Max LLM response tokens
|
|
|
|
# === Search ===
|
|
MAX_SEARCH_RESULTS = 3 # Web results per query
|
|
MIN_SEARCH_QUERY_LEN = 3 # Minimum search terms
|
|
|
|
# === Conversation Store ===
|
|
CONVERSATION_DB_PATH = os.path.join(
|
|
os.path.dirname(__file__), "data/conversations.db")
|
|
MAX_QUERY_LENGTH = 2000 # Characters for stored queries
|
|
MAX_RESPONSE_LENGTH = 10000 # Characters for stored responses
|
|
|
|
# === Model Settings ===
|
|
MODEL_TEMPERATURE = {
|
|
"simple": 0.3,
|
|
"medium": 0.6,
|
|
"complex": 0.7
|
|
}
|
|
|
|
MAX_CLASSIFY_ATTEMPTS = 3 # Task classification retries
|
|
|
|
# === Safety Limits ===
|
|
MAX_INPUT_LENGTH = 15000 # Absolute input character limit
|
|
MAX_CONTEXT_DEPTH = 5 # Max nested context references
|
|
|
|
# === Formatting ===
|
|
@staticmethod
|
|
def valid_range(num_options: int) -> str:
|
|
return f"0-{num_options - 1}"
|
|
|
|
@staticmethod
|
|
def code_block_regex():
|
|
return r'```python(.*?)```'
|
|
|
|
# === Path Helpers ===
|
|
@staticmethod
|
|
def chroma_path():
|
|
return "./data/chroma_db"
|
|
|
|
@staticmethod
|
|
def debug_log_path():
|
|
return f"{Config.LOG_DIR}/debug.txt"
|