Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class Config:
REPORT_AGENT_TEMPERATURE = float(os.environ.get('REPORT_AGENT_TEMPERATURE', '0.5'))

@classmethod
def validate(cls):
def validate(cls) -> list[str]:
"""Validate required configuration"""
errors = []
errors: list[str] = []
if not cls.LLM_API_KEY:
errors.append("LLM_API_KEY not configured (set to any non-empty value, e.g. 'ollama')")
if not cls.NEO4J_URI:
Expand Down
14 changes: 14 additions & 0 deletions backend/app/utils/file_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ class FileParser:

SUPPORTED_EXTENSIONS = {'.pdf', '.md', '.markdown', '.txt'}

@classmethod
def is_supported(cls, file_path: str) -> bool:
"""
Check whether the file is a supported format

Args:
file_path: Path to the file

Returns:
True if the file format is supported
"""
suffix = Path(file_path).suffix.lower()
return suffix in cls.SUPPORTED_EXTENSIONS

@classmethod
def extract_text(cls, file_path: str) -> str:
"""
Expand Down
10 changes: 5 additions & 5 deletions backend/app/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ def get_logger(name: str = 'mirofish') -> logging.Logger:


# Convenience functions
def debug(msg, *args, **kwargs):
def debug(msg: str, *args, **kwargs) -> None:
logger.debug(msg, *args, **kwargs)

def info(msg, *args, **kwargs):
def info(msg: str, *args, **kwargs) -> None:
logger.info(msg, *args, **kwargs)

def warning(msg, *args, **kwargs):
def warning(msg: str, *args, **kwargs) -> None:
logger.warning(msg, *args, **kwargs)

def error(msg, *args, **kwargs):
def error(msg: str, *args, **kwargs) -> None:
logger.error(msg, *args, **kwargs)

def critical(msg, *args, **kwargs):
def critical(msg: str, *args, **kwargs) -> None:
logger.critical(msg, *args, **kwargs)

2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "mirofish-offline-backend"
version = "0.2.0"
description = "MiroFish-Offline - Offline-first fork running on Neo4j + Ollama"
requires-python = ">=3.11"
requires-python = ">=3.11,<3.13"
license = { text = "AGPL-3.0" }
authors = [
{ name = "MiroFish Team" }
Expand Down
Loading