Skip to main content

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-generated LLMAction, or
    • A list of ManualAction or LLMAction instances, allowing the same agent to perform multiple actions within one timestep.

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():
For more details about the ActionType and corresponding arguments, please refer to the ActionType section.

ActionType

OASIS provides a comprehensive set of actions that simulate real social media behaviors:

Platform-Specific Actions

OASIS provides platform-specific action sets that can be accessed using class methods:

Reddit Actions

The Reddit action set includes:
  • LIKE_POST
  • DISLIKE_POST
  • CREATE_POST
  • CREATE_COMMENT
  • LIKE_COMMENT
  • DISLIKE_COMMENT
  • SEARCH_POSTS
  • SEARCH_USER
  • TREND
  • REFRESH
  • DO_NOTHING
  • FOLLOW
  • MUTE

Twitter Actions

The Twitter action set includes:
  • CREATE_POST
  • LIKE_POST
  • REPOST
  • FOLLOW
  • DO_NOTHING
  • QUOTE_POST

Arguments for ManualAction

CREATE_POST

LIKE_POST

UNLIKE_POST

DISLIKE_POST

UNDO_DISLIKE_POST

REPORT_POST

REPOST

QUOTE_POST

CREATE_COMMENT

LIKE_COMMENT

UNLIKE_COMMENT

DISLIKE_COMMENT

UNDO_DISLIKE_COMMENT

FOLLOW

UNFOLLOW

MUTE

UNMUTE

SEARCH_POSTS

SEARCH_USER

TREND

REFRESH

DO_NOTHING

PURCHASE_PRODUCT

INTERVIEW

CREATE_GROUP

JOIN_GROUP

LEAVE_GROUP

SEND_TO_GROUP

LISTEN_FROM_GROUP