From 561b3775c4ceac9eb532f2358c6f9c0198dd6352 Mon Sep 17 00:00:00 2001 From: Jimccy Date: Mon, 2 Jun 2025 00:10:31 +0800 Subject: [PATCH] Update configuration file handling to use UTF-8 encoding and modify agent name and work directory paths --- .env.example | 4 ---- api.py | 2 +- cli.py | 2 +- config.ini | 4 ++-- sources/tools/tools.py | 4 ++-- 5 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 .env.example diff --git a/.env.example b/.env.example deleted file mode 100644 index 069f23c1..00000000 --- a/.env.example +++ /dev/null @@ -1,4 +0,0 @@ -SEARXNG_BASE_URL="http://127.0.0.1:8080" -OPENAI_API_KEY='xxxxx' -DEEPSEEK_API_KEY='xxxxx' -OPENROUTER_API_KEY='xxxxx' \ No newline at end of file diff --git a/api.py b/api.py index fa828960..c468d810 100755 --- a/api.py +++ b/api.py @@ -30,7 +30,7 @@ celery_app.conf.update(task_track_started=True) logger = Logger("backend.log") config = configparser.ConfigParser() -config.read('config.ini') +config.read('config.ini', encoding='utf-8') api.add_middleware( CORSMiddleware, diff --git a/cli.py b/cli.py index d69bc64a..5ea0ed0f 100755 --- a/cli.py +++ b/cli.py @@ -15,7 +15,7 @@ warnings.filterwarnings("ignore") config = configparser.ConfigParser() -config.read('config.ini') +config.read('config.ini', encoding='utf-8') async def main(): pretty_print("Initializing...", color="status") diff --git a/config.ini b/config.ini index 19cb1e47..4e89c4fb 100644 --- a/config.ini +++ b/config.ini @@ -3,12 +3,12 @@ is_local = True provider_name = ollama provider_model = deepseek-r1:14b provider_server_address = 127.0.0.1:11434 -agent_name = Name_of_your_AI +agent_name = AiAiAiA recover_last_session = False save_session = False speak = False listen = False -work_dir = /Users/mlg/Documents/workspace_for_agenticseek +work_dir = \Users\user\OneDrive\文件\agenticSeek jarvis_personality = False languages = en [BROWSER] diff --git a/sources/tools/tools.py b/sources/tools/tools.py index 555f30cc..2b607ffd 100644 --- a/sources/tools/tools.py +++ b/sources/tools/tools.py @@ -1,4 +1,3 @@ - """ define a generic tool class, any tool can be used by the agent. @@ -39,6 +38,7 @@ def __init__(self): self.messages = [] self.logger = Logger("tools.log") self.config = configparser.ConfigParser() + self.config.read('./config.ini', encoding='utf-8') self.work_dir = self.create_work_dir() self.excutable_blocks_found = False self.safe_mode = True @@ -72,7 +72,7 @@ def create_work_dir(self): """Create the work directory if it does not exist.""" default_path = os.path.dirname(os.getcwd()) if self.config_exists(): - self.config.read('./config.ini') + self.config.read('./config.ini', encoding='utf-8') config_path = self.config['MAIN']['work_dir'] dir_path = default_path if not self.check_config_dir_validity() else config_path else: