Skip to content

Commit

Permalink
update (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayrayraykk authored Oct 21, 2024
1 parent 9711248 commit 2dfe7cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/agentscope/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
""" Some constants used in the project"""
import os
from numbers import Number
from enum import IntEnum

Expand All @@ -19,7 +20,16 @@
_DEFAULT_SUBDIR_CODE = "code"
_DEFAULT_SUBDIR_FILE = "file"
_DEFAULT_SUBDIR_INVOKE = "invoke"
_DEFAULT_CACHE_DIR = str(Path.home() / ".cache" / "agentscope")
_DEFAULT_CACHE_DIR = str(
Path(
os.environ.get(
"AS_HOME_PATH",
str(Path.home()),
),
)
/ ".cache"
/ "agentscope",
)
_DEFAULT_CFG_NAME = ".config"
_DEFAULT_IMAGE_NAME = "image_{}_{}.png"
_DEFAULT_SQLITE_DB_NAME = "agentscope.db"
Expand Down
3 changes: 2 additions & 1 deletion src/agentscope/studio/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from flask_socketio import SocketIO, join_room, leave_room

from ..constants import (
_DEFAULT_CACHE_DIR,
_DEFAULT_SUBDIR_CODE,
_DEFAULT_SUBDIR_INVOKE,
FILE_SIZE_LIMIT,
Expand All @@ -44,7 +45,7 @@
_app = Flask(__name__)

# Set the cache directory
_cache_dir = Path.home() / ".cache" / "agentscope-studio"
_cache_dir = Path(_DEFAULT_CACHE_DIR) / "studio"
_cache_db = _cache_dir / "agentscope.db"
os.makedirs(str(_cache_dir), exist_ok=True)

Expand Down

0 comments on commit 2dfe7cf

Please sign in to comment.