Skip to content

Commit edb3a16

Browse files
committed
update prompt
1 parent 0ad7d0a commit edb3a16

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

oasis/social_agent/agent.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ def __init__(
6868
self.twitter_channel = twitter_channel
6969
self.infe_channel = inference_channel
7070
self.env = SocialEnvironment(SocialAction(agent_id, twitter_channel))
71-
self.system_message = BaseMessage.make_assistant_message(
72-
role_name="User",
73-
content=self.user_info.to_system_message(action_space_prompt),
74-
)
7571
self.model_type = model_type
7672
self.is_openai_model = is_openai_model
7773
if self.is_openai_model:
@@ -93,7 +89,7 @@ def __init__(
9389
)
9490
self.memory = ChatHistoryMemory(context_creator, window_size=5)
9591
self.system_message = BaseMessage.make_assistant_message(
96-
role_name="system",
92+
role_name="A Humorous Twitter User",
9793
content=self.user_info.to_system_message(
9894
action_space_prompt), # system prompt
9995
)
@@ -114,7 +110,7 @@ async def perform_action_by_llm(self):
114110
# Get posts:
115111
env_prompt = await self.env.to_text_prompt()
116112
user_msg = BaseMessage.make_user_message(
117-
role_name="User",
113+
role_name="A Humorous Twitter User",
118114
# content=(
119115
# f"Please perform social media actions after observing the "
120116
# f"platform environments. Notice that don't limit your "
@@ -146,14 +142,15 @@ async def perform_action_by_llm(self):
146142
"role": self.system_message.role_name,
147143
"content": self.system_message.content,
148144
}] + [user_msg.to_openai_user_message()]
149-
agent_log.info(
150-
f"Agent {self.agent_id} is running with prompt: {openai_messages}")
145+
# agent_log.info(
146+
# f"Agent {self.agent_id} is running with prompt: "
147+
# f"{openai_messages}")
151148

152149
if self.is_openai_model:
153150
try:
154151
response = await self.model_backend._arun(
155152
openai_messages, tools=self.full_tool_schemas)
156-
agent_log.info(f"Agent {self.agent_id} response: {response}")
153+
# agent_log.info(f"Agent {self.agent_id} response: {response}")
157154
content = response
158155
for tool_call in response.choices[0].message.tool_calls:
159156
action_name = tool_call.function.name

oasis/social_agent/agent_action.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async def create_post(self, content: str):
131131
Args:
132132
content (str): The content of the post to be created. Please
133133
includes more emojis and hashtags to make your post more
134-
attractive.
134+
attractive. Note that you are human twitter user.
135135
136136
Returns:
137137
dict: A dictionary with two key-value pairs. The 'success' key
@@ -502,7 +502,7 @@ async def create_comment(self, post_id: int, content: str):
502502
added.
503503
content (str): The content of the comment to be created. Please
504504
includes more emojis and hashtags to make your post more
505-
attractive.
505+
attractive. Note that you are human twitter user.
506506
507507
Returns:
508508
dict: A dictionary with two key-value pairs. The 'success' key

oasis/social_platform/config/user.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ def to_twitter_system_message(self,
5555

5656
system_content = f"""
5757
# SELF-DESCRIPTION
58+
You're a Twitter user, and I'll present you with some posts. After you see the posts, choose some actions from the following functions.
59+
Please role play as the Twitter user described below.
60+
61+
{description}
62+
5863
Your actions should be consistent with your self-description and personality.
5964
6065
If you are a celebrity, your show mock the behavior of the celebrity.
@@ -63,9 +68,6 @@ def to_twitter_system_message(self,
6368
you should try to be more interesting and Witty banter.
6469
For example, you can try to create some creative and hilarious content.
6570
66-
{description}
67-
68-
6971
# RESPONSE FORMAT
7072
Your answer should follow the response format:
7173

0 commit comments

Comments
 (0)