Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 1.96 KB

File metadata and controls

9 lines (6 loc) · 1.96 KB

I want to create an agent using the Google ADK framework that recreates the classic "Peanut Butter and Jelly Sandwich" activity from computer science classes, where a student has to describe how to create a PB&J sandwich in precise steps but the teacher interprets each step very literally, often leading to comic mistakes. In this program, the user will act as the student and the agent will act as a robot following the directions. The program will use image generation to generate images representing the state of the robot as it is following steps. Here are specific requirements for this app:

  • The student is met with an initial image of a robot hovering over a cutting board. This is the ai-start-tobot.jpg file. The text says "Welcome! Please help this AI robot make a peanut butter and jelly sandwich. Give it precise instructions one step at a time. Start any instruction with "Start over" to reset the robot. But be careful - you only have 6 attempts to make the sandwich before the AI is done for the day!"
  • When the user sends a command, the agent evaluates the command as a teacher would: trying to find silly, creative, literal interpretations of the command that can derail what the student asks. From there, it generates a description of the state of the robot. If the command is well-articulated and careful, then it can be carried out as expected
  • The agent then uses a tool to generate an image based on the state of the robot, and then displays the resulting image to the student. The most up-to-date syntax for image generation and tool usage is provided in the example files.
  • The agent then displays the image and describes what has happened, and asks the user for their next step.
  • Behind the scenes, a counter is used to keep track of the number of chats the user has. Once the user has had 6 interactions with the chatbot, no more messages can be sent and a before_model_callback function is used to interrupt the model call and instead say "No more messages for now!"