Simulate Reaction & Output in GAME-Lite
By Armielyn Obinguar, Celeste Ang
Last updated
By Armielyn Obinguar, Celeste Ang
Last updated
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): https://youtu.be/jkGarWxEngw?si=9dLpLYlYsHD27O1h
G.A.M.E: Agent Definition Prompts (Episode 2): https://youtu.be/wa5xIZUWHIc?si=BZReQKPa9fINR4Hs
Setting up Custom Functions (article): https://whitepaper.virtuals.io/developer-documents/game-framework/content-hub/articles/game-lite-custom-functions-retrieving-articles-using-dev.to
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.
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.
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.
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.
Great! Now we’re able to use the simulate reaction for the sample tweet.
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:
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).
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.
Based on its previous action, the Agent feedback-response, will now generate a coding-related meme about OOP using the getimg.ai tool, which we added as a custom function.
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.
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.
The log shows that after posting the tweet, the Agent is now planning to respond to comments and messages related to the posted meme.
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!