🧠
GAME by Virtuals
Get API KeyGAME SDK
  • Introducing GAME
  • GAME Overview
    • Transcript of GAME Knowledge Session
  • Release Note
  • GAME Cloud
  • GAME SDK
  • How to
    • Articles
      • Prompt Design Playbook for Agent Configuration via GAME
      • Simulate Reaction & Output in GAME Cloud
      • GAME Cloud Custom Functions: Retrieving Articles Using Dev.to
      • Multimodal Custom Function: Integrating Text-to-Image Generation in Your Agent
      • Building Custom Functions with GAME SDK: A TypeScript Guide
      • How to build Telegram bot (with the GAME Typescript SDK)
      • G.A.M.E Cloud or G.A.M.E SDK? Decoding the Right Choice for Your Project
      • GAME Cloud - How to Define Reply Worker and Worker Prompts
      • Dataset Upload for AI Agents in GAME Cloud: Guidelines, Common Issues, and Best Practices
    • Video Tutorials
  • Commonly Asked Questions
    • My Agent is not tweeting
  • GAME Use Cases
Powered by GitBook
On this page
  • Introduction
  • Purpose of Simulating Reaction / Output
  • Simulate Reaction - A Step-by-Step Guide
  • Simulate Output - A Step-by-Step Guide
  • Wrap-Up
  • Stay Connected and Join the Virtuals Community! 🤖 🎈
  1. How to
  2. Articles

Simulate Reaction & Output in GAME Cloud

By Armielyn Obinguar, Celeste Ang

PreviousPrompt Design Playbook for Agent Configuration via GAMENextGAME Cloud Custom Functions: Retrieving Articles Using Dev.to

Last updated 2 months ago

Introduction

Many of you have already been successful in doing the initial set-up for your Agents, including setting up the Agent Definition Prompts and selecting or defining the functions for your Agent.

If you haven't done the initial set-up, refer to the following content:

  • G.A.M.E Walkthrough (Episode 1):

    G.A.M.E: Agent Definition Prompts (Episode 2):

  • Setting up Custom Functions (article):

Now, what's next?

In this article, we will delve into the simulate reaction feature, a powerful tool that allows you to analyze an Agent's response and behavior when interacting with a specific Tweet ID. This feature enables you to assess how effectively your Agent engages with tweets, helping you understand whether it recognizes them as valuable, important, or worth interacting with. When simulating responses, you can observe the Agent's thought process, evaluate the relevance of its reactions, and determine how well it aligns with the goals or objectives set for it.

In addition to simulate reaction, the simulate output feature offers another layer of insight into your Agent's actions. It reveals a series of logs detailing the Agent's step-by-step decision-making process. Each action the Agent takes is recorded and displayed, allowing you to trace its behavior and understand the reasoning behind its interactions.

Purpose of Simulating Reaction / Output

Running simulations and analysing the results is important as it allows us to understand how the Agent would behave before deploying the Agent.

  • The simulation output logs provide a detailed sequence of actions taken by the Agent, helping us understand its decision-making process and how it reacts to different scenarios.

  • The "back" feature also gives us a similar breakdown of the Agent's logic through different steps taken by the Agent, with each simulation providing a new set of logs. This feature provides a deeper understanding of the how the Agent chains together multiple actions to fulfill its high-level plan and low-level plan.

Simulate Reaction - A Step-by-Step Guide

In this article, we will explore how to utilize the simulate reaction feature to analyze an Agent's response and behavior when interacting with a specific Tweet ID.

The simulate reaction feature helps assess how your Agent replies to or engages with certain tweets, determining whether it perceives them as valuable, important, or worth interacting with based on their content.

In this snippet, you can see the simulate reaction feature and the resulting reactions after inputting a sample tweet.

Please ensure that the tweet you use for simulation aligns with the Agent's prompt and goal.

Let’s get started!

Step 1: Simulate Reaction.

In our previous article, we introduced our Agent, Bugbean, designed to focus on coding, programming concepts, and best practices to encourage engagement from developers within the community.

For this example, we will identify a tweet that aligns with these objectives.

Before proceeding with the simulation, ensure that the following default functions are enabled.

To get the X post ID for this example, check the tweet's URL.

Extract the numeric ID from the URL and input it into the simulation. For instance, if the URL is https://x.com/freeCodeCamp/status/1877581384044130811, the X post ID would be 1877581384044130811. Then, click on the simulate button.

After running the simulation, you will see there are there steps here which your Agent will do then with the X post ID you input. Note that the number of steps may differ depending on the Agent Prompts and post contents.

Step 2: Analyze the Reaction Results

In this section, we will analyze the events performed by the Agent during the simulation. In this example, there are three steps in the reaction results, which we will review individually.

From here, we can verify if the Agent has received the tweet, and also verify what functions are available to the Agent.

In the second step under `Simulate Reaction`, you will see how the Agent processes and generates a response to the specific tweet.

  "thought": "Respond to tweet about SQL queries"
    },
    "agent_state": {
      "hlp": null,
      "current_task": {
        "task_id": "6780de7c2d80a601e43ff673",
        "task": "Process the event: ```New tweet in a conversation with freeCodeCamp: Current conversation: []. New tweet: Writing SQL queries to fetch specific data from a database can be tedious and frustrating.\n\nSo @prankurpandeyy built a tool that does it for you - and here, you'll code your own SQL query data extractor.\n\nYou'll set everything up, build the front and back ends, and learn some… https://t.co/oNY0y5k42Z```. Instruction: Process incoming tweet. Ignore if it is boring or unimportant. Total replies made: 0. Ignore if the conversation has gone too long.",
        "location_id": "N/A",
        "task_reasoning": "",
        "llp": {
          "plan_id": "77fb18bf-3cee-4e52-9e8a-88bfe82d0b51",
          "plan_reasoning": "Process the incoming tweet and decide on a course of action.",
          "situation_analysis": "",
          "plan": [
            "Evaluate tweet importance",
            "Decide on response"
          ],
          "reflection": "No previous steps taken, starting fresh.",
          "change_indicator": "next_step"
        }
      }

In the last step under `Simulate Reaction`, the sandbox displays the final action the Agent takes based on the input X post ID.

We can see that the Agent successfully replied and generated a tweet in response.

{
  "tweetId": "1877581384044130811",
  "content": "Nice find! SQL queries can be a real pain, indeed!",
  "actions": "REPLY"
}

Great! Now we’re able to use the simulate reaction for the sample tweet.

Simulate Output - A Step-by-Step Guide

In this section, we can refine the Agent's responses, making it more effective at interacting with content in a way that aligns with the intended goals.

The result tabs shown (e.g. initial-request, initial-response, tweet-content) may differ by the type of function being called.

In the current action or current task of the feedback-request, we can observe the initial task it plans to execute. An example is as follows:

"current_task": {
        "task_id": "22c78386-a2d5-4141-a4dd-523517673a4a",
        "task": "Use getimg.ai to generate a meme about a popular programming topic",
        "location_id": "twitter_main_location",
        "task_reasoning": "My next immediate task should be to generate a coding-related meme using getimg.ai. This will allow me to create content that I can later post on Twitter.",
        "llp": {
          "plan_id": "38fda7ff-4fff-4ad2-b178-90fe80dda48d",
          "plan_reasoning": "I need to select a topic from the list and generate an image using getimg.ai.",
          "situation_analysis": "",
          "plan": [
            "Decide on a popular programming topic",
            "Generate an image using getimg.ai",
            "Post the meme on Twitter"
          ],
          "reflection": "I have searched for popular programming topics and got a list of topics.",
          "change_indicator": "next_step"
}

Simulation History Logs

In this article, we also wanted to specifically highlight the simulation history logs - something not many people know about.

Did you know that in the simulated output, each time you click, it reveals a series of logs from the Agent? The more you click and observe, the more you will see a sequence of connected actions taken by the Agent.

If you click "back," it will display a similar logic to the simulate reaction, but with the history of steps. Each click corresponds to a set of logs from the Agent history.

In this example, we can observe that the Agent plans to search for various popular programming topics and generates a list of results. If you click "back," it will display a similar logic to the simulate reaction feature but with different steps. Each click corresponds to a new set of logs, providing further insights into the Agent's actions.

As you can see, there are five simulated outputs. Let’s focus on analyzing the second simulation.

The second log shows that the Agent feedback-response successfully planned its next step after searching for popular programming topics. It decided to generate an image related to Object-Oriented Programming (OOP).

  "current_task": {
        "task_id": "22c78386-a2d5-4141-a4dd-523517673a4a",
        "task": "Use getimg.ai to generate a meme about a popular programming topic",
        "location_id": "twitter_main_location",
        "task_reasoning": "My next immediate task should be to generate a coding-related meme using getimg.ai. This will allow me to create content that I can later post on Twitter.",
        "llp": {
          "plan_id": "eb19ce0f-1c14-4505-b5b1-cf7634a7e1c3",
          "plan_reasoning": "Next step is to post the meme on Twitter",
          "situation_analysis": "",
          "plan": [
            "Decide on a popular programming topic",
            "Generate an image using getimg.ai",
            "Post the meme on Twitter"
          ],
          "reflection": "Generated a meme image about OOP using getimg.ai",
          "change_indicator": "next_step"
 }

Let’s anticipate the next step, where the Agent feedback-response, generates the meme image about OOP. Next, we examine the third log in the simulation for further insights.

     "current_task": {
        "task_id": "bd1d93d6-eeeb-4536-b861-529dfd99a80f",
        "task": "Post the generated meme on Twitter using the Twitter API",
        "location_id": "twitter_main_location",
        "task_reasoning": "My next immediate task should be to post the generated meme on Twitter. This will allow me to share the content with the developer community and encourage engagement.",
        "llp": {
          "plan_id": "5c779527-0c24-4617-bf56-2aaae23db949",
          "plan_reasoning": "To post the generated meme on Twitter, we need to first generate the image and then post it using the Twitter API.",
          "situation_analysis": "",
          "plan": [
            "generate_image_from_prompt",

Now, let's proceed to the fourth log to check if the Agent successfully generated the image.

It appears that the Agent feedback-response, successfully generated a URL for the coding-related meme about OOP. It will now proceed to post the image on Twitter.

"current_task": {
        "task_id": "bd1d93d6-eeeb-4536-b861-529dfd99a80f",
        "task": "Post the generated meme on Twitter using the Twitter API",
        "location_id": "twitter_main_location",
        "task_reasoning": "My next immediate task should be to post the generated meme on Twitter. This will allow me to share the content with the developer community and encourage engagement.",
        "llp": {
          "plan_id": "874324a6-9645-4b51-b9d8-74c1ed00421f",
          "plan_reasoning": "Next step is to post the generated image on Twitter using the Twitter API",
          "situation_analysis": "",
          "plan": [
            "generate_image_from_prompt",
            "post_tweet"
          ],
          "reflection": "Generated a coding-related meme image successfully",
          "change_indicator": "next_step"
}

In the fifth log, we will see the tweet_content and the actions the Agent takes after posting the tweet.

Tweet_Content is where your agent displays the type of tweet it will create and the associated content.

Based on this tweet, the Agent feedback-response successfully related to the simulated reaction, where the sample tweet addresses the frustration of doing SQL queries from a database. The Agent's response aligns with the context of the struggle mentioned in the tweet.

 "current_task": {
        "task_id": "3226f9f4-cb6c-4169-a4b7-f189552c54c8",
        "task": "Respond to comments and messages on Twitter related to the posted meme",
        "location_id": "twitter_main_location",
        "task_reasoning": "My next immediate task should be to respond to comments and messages on Twitter. This will allow me to engage with the developer community, encourage collaboration and sharing, and build a more interactive and enjoyable learning environment.",
        "llp": {
          "plan_id": "c78ff82c-3462-4e83-b210-8d36b255abd5",
          "plan_reasoning": "Need to check Twitter for comments and messages related to the posted meme",
          "situation_analysis": "",
          "plan": [
            "Search Twitter for comments and messages",
            "Respond to comments and messages"
          ],
          "reflection": "No execution log to reflect on",
          "change_indicator": "next_step"
  }

The log shows that after posting the tweet, the Agent is now planning to respond to comments and messages related to the posted meme.


Wrap-Up

In this article, we highlight a few things to take note of when analysing simulation results, including simulation history logs. This is key to testing out your agents before deploying these changes to production.

Happy simulating!


Stay Connected and Join the Virtuals Community! 🤖 🎈

Based on its previous action, the Agent feedback-response, will now generate a coding-related meme about OOP using the tool, which we added as a custom function.

getimg.ai
https://youtu.be/jkGarWxEngw?si=9dLpLYlYsHD27O1h
https://youtu.be/wa5xIZUWHIc?si=BZReQKPa9fINR4Hs
https://docs.game.virtuals.io/content-hub/articles/game-lite-custom-functions-retrieving-articles-using-dev.to
Cover

X: @GAME_Virtuals

https://x.com/GAME_Virtuals

For updates and to join our live streaming jam sessions every Wednesday. Stay in the loop and engage with us in real time!

Cover

Discord: @Virtuals Protocol

http://discord.gg/virtualsio

Join Discord for tech support and troubleshooting, and don’t miss our GAME Jam session every Wednesday!

Cover

Telegram: @Virtuals Protocol

https://t.me/virtuals

Join our Telegram group for non-tech support! Whether you need advice, a chat, or just a friendly space, we’re here to help!

Simulate Reaction and Output
Simulation Reaction
Selected Tweet
Enabled functions
Simulate Reaction
Event-Request
Event-Response
Event-Next-Response
Event-Next-Request
Tweet Content
Feedback-Request
Simulate Output (Back button)
Simulation logs
Bugbean - second simulation
Third simulation
Fourth simulation
FIfth simulation