mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 17:18:29 +00:00
- add type annotations across utility modules - refactor printer system, agent utils, and imports for consistency - remove unused modules, constants, and redundant patterns - improve runtime type checks, exception handling, and guardrail validation - standardize warning suppression and logging utilities - fix llm typing, threading/typing edge cases, and test behavior
26 lines
651 B
Python
26 lines
651 B
Python
"""Path management utilities for CrewAI storage and configuration."""
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
import appdirs
|
|
|
|
|
|
def db_storage_path() -> str:
|
|
"""Returns the path for SQLite database storage.
|
|
|
|
Returns:
|
|
str: Full path to the SQLite database file
|
|
"""
|
|
app_name = get_project_directory_name()
|
|
app_author = "CrewAI"
|
|
|
|
data_dir = Path(appdirs.user_data_dir(app_name, app_author))
|
|
data_dir.mkdir(parents=True, exist_ok=True)
|
|
return str(data_dir)
|
|
|
|
|
|
def get_project_directory_name() -> str:
|
|
"""Returns the current project directory name."""
|
|
return os.environ.get("CREWAI_STORAGE_DIR", Path.cwd().name)
|