Actions for env.step
The actions
parameter passed to the OASIS environment’s step
method should be a dictionary that specifies what each agent should do at a given timestep, as shown below:
- The key is a
SocialAgent
. - The value is either:
- A single predefined
ManualAction
or an LLM-generatedLLMAction
, or - A list of
ManualAction
orLLMAction
instances, allowing the same agent to perform multiple actions within one timestep.
- A single predefined
LLMAction
You can use LLMAction()
to indicate that an agent should perform actions based on the output of an LLM. These actions can include both social actions and external tools, as defined during initialization.
An example where all agents use LLMAction()
to perform actions:
ManualAction
You can use ManualAction()
to indicate that an agent should perform actions based on the predefined ActionType
and corresponding arguments.
- The data structure of
ManualAction
:
- A example of using
ManualAction()
:
ActionType
and corresponding arguments, please refer to the ActionType section.
ActionType
OASIS provides a comprehensive set of actions that simulate real social media behaviors:
Action Type | Description |
---|---|
SIGNUP | Register a new user with username, name, and bio |
CREATE_POST | Create a new post with text content |
LIKE_POST | Like or upvote a post |
UNLIKE_POST | Remove a like from a previously liked post |
DISLIKE_POST | Dislike or downvote a post |
UNDO_DISLIKE_POST | Remove a dislike from a previously disliked post |
REPOST | Repost content without modification (equivalent to retweet) |
QUOTE_POST | Repost with additional commentary |
CREATE_COMMENT | Create a comment on a post |
LIKE_COMMENT | Like a comment |
UNLIKE_COMMENT | Remove a like from a previously liked comment |
DISLIKE_COMMENT | Dislike a comment |
UNDO_DISLIKE_COMMENT | Remove a dislike from a previously disliked comment |
FOLLOW | Follow another user |
UNFOLLOW | Unfollow a previously followed user |
MUTE | Mute another user (hide their content without unfollowing) |
UNMUTE | Unmute a previously muted user |
SEARCH_POSTS | Search for posts by keywords, post ID, or user ID |
SEARCH_USER | Search for users by username, name, bio, or user ID |
TREND | Get trending content based on popularity metrics |
REFRESH | Refresh the timeline to get recommended posts |
DO_NOTHING | Perform no action (pass the turn) |
PURCHASE_PRODUCT | Purchase a product (for e-commerce simulations) |
INTERVIEW | Interview a user and record the interview result in the database |
CREATE_GROUP | Create a new group with a given name |
JOIN_GROUP | Join a group by group ID |
LEAVE_GROUP | Leave a group by group ID |
SEND_TO_GROUP | Send a message to a group |
LISTEN_FROM_GROUP | Listen for messages from groups |
Platform-Specific Actions
OASIS provides platform-specific action sets that can be accessed using class methods:Reddit Actions
LIKE_POST
DISLIKE_POST
CREATE_POST
CREATE_COMMENT
LIKE_COMMENT
DISLIKE_COMMENT
SEARCH_POSTS
SEARCH_USER
TREND
REFRESH
DO_NOTHING
FOLLOW
MUTE
Twitter Actions
CREATE_POST
LIKE_POST
REPOST
FOLLOW
DO_NOTHING
QUOTE_POST