Refactor content handling in activity logging and simulation scripts

- Removed content truncation logic from the AgentActivity class, allowing full content to be logged for posts, comments, and quotes.
- Updated the `fetch_new_actions_from_db` function to retain complete content in action arguments, enhancing data accuracy.
- Adjusted simulation scripts to ensure that full content is sent during action creation, improving the representation of agent activities.
This commit is contained in:
666ghj
2025-12-05 18:30:40 +08:00
parent e9b49e38bf
commit 29bff9ca27
2 changed files with 5 additions and 12 deletions

View File

@@ -63,9 +63,6 @@ class AgentActivity:
def _describe_create_post(self) -> str:
content = self.action_args.get("content", "")
if content:
# 截取内容,避免过长
if len(content) > 300:
content = content[:300] + "..."
return f"发布了一条帖子:「{content}"
return "发布了一条帖子"
@@ -86,7 +83,7 @@ class AgentActivity:
content = self.action_args.get("content", "")
if quoted_id:
if content:
return f"引用帖子#{quoted_id}并评论:「{content[:100]}{'...' if len(content) > 100 else ''}"
return f"引用帖子#{quoted_id}并评论:「{content}"
return f"引用了帖子#{quoted_id}"
return "引用了一条帖子"
@@ -98,8 +95,6 @@ class AgentActivity:
content = self.action_args.get("content", "")
post_id = self.action_args.get("post_id", "")
if content:
if len(content) > 200:
content = content[:200] + "..."
base = f"评论道:「{content}"
if post_id:
base = f"在帖子#{post_id}{base}"