Get Data Dir • AI Agent SDK

get_data_dir: Get PraisonAI data directory.

get_data_dir

Function

</div>

This function is defined in the paths module.

Get PraisonAI data directory.

Priority:

  1. PRAISONAI_HOME env var
  2. ~/.praisonai/ (existing install)
  3. ~/.praison/ (legacy fallback with warning)
  4. $XDG_DATA_HOME/praisonai (only when XDG_DATA_HOME is explicitly set
  5. and no legacy root exists)
  6. ~/.praisonai/ (default for fresh installs)

Signature

python
def get_data_dir() -> Path

Returns

ResponseField Path

Path to data directory

Usage

python
>>> from praisonaiagents.paths import get_data_dir
    >>> data_dir = get_data_dir()
    >>> print(data_dir)
    /home/user/.praisonai

Uses

  • expanduser
  • Path
  • Path.home
  • new_path.exists
  • legacy_path.exists
  • warn_deprecated_param
  • isabs

Used By

Source

View on GitHub

praisonaiagents/paths.py at line 126