Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Commit

Permalink
fix: typo in env var keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ToJen committed Oct 28, 2024
1 parent 8bb44d9 commit 239fb73
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions hive_agent/chat/chat_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ async def add_message(self, db_manager: DatabaseManager, role: str, content: Any

async def get_messages(self, db_manager: DatabaseManager):
filters = {"user_id": [self.user_id], "session_id": [self.session_id]}
if "AGENT_ID" in os.environ:
filters["agent_id"] = os.getenv("AGENT_ID", "")
if "SWARM_ID" in os.environ:
filters["swarm_id"] = os.getenv("SWARM_ID", "")
if "HIVE_AGENT_ID" in os.environ:
filters["agent_id"] = os.getenv("HIVE_AGENT_ID", "")
if "HIVE_SWARM_ID" in os.environ:
filters["swarm_id"] = os.getenv("HIVE_SWARM_ID", "")

db_chat_history = await db_manager.read_data("chats", filters)
chat_history = [ChatMessage(role=chat["role"], content=chat["message"]) for chat in db_chat_history]
return chat_history

async def get_all_chats_for_user(self, db_manager: DatabaseManager):
filters = {"user_id": [self.user_id]}
if "AGENT_ID" in os.environ:
filters["agent_id"] = os.getenv("AGENT_ID", "")
if "SWARM_ID" in os.environ:
filters["swarm_id"] = os.getenv("SWARM_ID", "")
if "HIVE_AGENT_ID" in os.environ:
filters["agent_id"] = os.getenv("HIVE_AGENT_ID", "")
if "HIVE_SWARM_ID" in os.environ:
filters["swarm_id"] = os.getenv("HIVE_SWARM_ID", "")

db_chat_history = await db_manager.read_data("chats", filters)

Expand Down

0 comments on commit 239fb73

Please sign in to comment.