Skip to content
Closed
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
8 changes: 4 additions & 4 deletions plugins/memory/hindsight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ def save_config(self, values, hermes_home):
existing = {}
if config_path.exists():
try:
existing = json.loads(config_path.read_text())
existing = json.loads(config_path.read_text(encoding="utf-8"))
except Exception:
pass
existing.update(values)
Expand Down Expand Up @@ -895,7 +895,7 @@ def post_setup(self, hermes_home: str, config: dict) -> None:
env_path = Path(hermes_home) / ".env"
existing_llm_key = ""
if env_path.exists():
for line in env_path.read_text().splitlines():
for line in env_path.read_text(encoding="utf-8").splitlines():
if line.startswith("HINDSIGHT_LLM_API_KEY="):
existing_llm_key = line.split("=", 1)[1]
break
Expand Down Expand Up @@ -925,7 +925,7 @@ def post_setup(self, hermes_home: str, config: dict) -> None:
env_path.parent.mkdir(parents=True, exist_ok=True)
existing_lines = []
if env_path.exists():
existing_lines = env_path.read_text().splitlines()
existing_lines = env_path.read_text(encoding="utf-8").splitlines()
updated_keys = set()
new_lines = []
for line in existing_lines:
Expand All @@ -938,7 +938,7 @@ def post_setup(self, hermes_home: str, config: dict) -> None:
for k, v in env_writes.items():
if k not in updated_keys:
new_lines.append(f"{k}={v}")
env_path.write_text("\n".join(new_lines) + "\n")
env_path.write_text("\n".join(new_lines) + "\n", encoding="utf-8")

if mode == "local_embedded":
materialized_config = dict(provider_config)
Expand Down