Skip to content

Commit 8a891ab

Browse files
committed
fix: rm unnecessary change
1 parent 2ff68ed commit 8a891ab

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

oasis/environment/env.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,12 @@ async def _load_user_profiles(self) -> None:
161161
if isinstance(data, dict) and "user_profiles" in data:
162162
# New format: data with timestamps
163163
raw_profiles = data["user_profiles"]
164-
# 确保所有 key 都是字符串类型
165164
self.user_profiles = {str(k): v for k, v in raw_profiles.items()}
166165
self._profile_update_count = data.get("update_count", 0)
167166
env_log.info(f"Loaded {len(self.user_profiles)} user profiles from {self.user_profile_file} (last updated: {data.get('last_updated', 'unknown')}, update #{self._profile_update_count})")
168167
env_log.info(f"Profile keys loaded: {list(self.user_profiles.keys())}")
169168
else:
170169
# Old format: direct user profile data
171-
# 确保所有 key 都是字符串类型
172170
self.user_profiles = {str(k): v for k, v in data.items()}
173171
self._profile_update_count = 0
174172
env_log.info(f"Loaded {len(self.user_profiles)} user profiles from {self.user_profile_file} (legacy format)")

oasis/social_agent/agent.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,10 @@ async def perform_action_by_llm(self):
132132
f"platform environments. Notice that don't limit your "
133133
f"actions for example to just like the posts. "
134134
f"Here is your social media environment: {env_prompt}"))
135-
#print(f'user_info: {self.user_info}')
136-
#print(f'env_prompt: {env_prompt}')
137135
try:
138-
# agent_log.info(
139-
# f"Agent {self.social_agent_id} observing environment: "
140-
# f"{env_prompt}")
136+
agent_log.info(
137+
f"Agent {self.social_agent_id} observing environment: "
138+
f"{env_prompt}")
141139
response = await self.astep(user_msg)
142140
for tool_call in response.info['tool_calls']:
143141
action_name = tool_call.tool_name

oasis/social_agent/agents_generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ async def generate_controllable_agents(
359359
}},
360360
recsys_type="reddit",
361361
)
362-
362+
# All controllable agent_ids come before LLM agent_ids
363363
agent = SocialAgent(agent_id=i,
364364
user_info=user_info,
365365
channel=channel,
@@ -378,7 +378,7 @@ async def generate_controllable_agents(
378378
for i in range(control_user_num):
379379
for j in range(control_user_num):
380380
agent = agent_graph.get_agent(i)
381-
381+
# All controllable agents follow each other
382382
if i != j:
383383
user_id = agent_user_id_mapping[j]
384384
await agent.env.action.follow(user_id)
@@ -407,7 +407,7 @@ async def gen_control_agents_with_data(
407407
},
408408
recsys_type="reddit",
409409
)
410-
410+
# All controllable agent_ids come before LLM agent_ids
411411
agent = SocialAgent(
412412
agent_id=i,
413413
user_info=user_info,

oasis/social_platform/database.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@ def create_db(db_path: str | None = None):
8989
if db_path is None:
9090
db_path = get_db_path()
9191

92-
# If the database file already exists, return the connection and cursor directly
93-
if osp.exists(db_path):
94-
print(f"Database file {db_path} already exists, skipping creation.")
95-
conn = sqlite3.connect(db_path)
96-
cursor = conn.cursor()
97-
return conn, cursor
98-
9992
# Connect to the database:
10093
print("db_path", db_path)
10194
conn = sqlite3.connect(db_path)

0 commit comments

Comments
 (0)