Building solutions using LLM AutoGen in Python – Part 2

Let us understand the rest of the post as a continuation of the previous post. But before that, please refer to the previous post.

But before that, I’m adding the demo here at the beginning one more time.


For continuation, I have posted the process flow, which we discussed in the earlier post.


We’ll analyze the prompt engineering in today’s post.

But, before that, let us understand the flow of process by the agents & how they work together as one team –

But, for more clarity let’s understand the roles of individual agents that you want to define –

The first prompt is relatively simple, as it asks to build a simple user interface for the Game of Snake (Which we used to play a lot using our first Nokia mobile phones).

And, it didn’t exactly build what we were anticipating at first glance. And, it came out with something like this –

Even though it creates the Snake marked with Green objects on top of the white screen, it lacks many things. For example, the Snake briefly leaves the visual box and appears from the opposite side once it reaches a wall. It doesn’t have a target to hit, a score to show, or a timer to control the play hours per session per person, i.e., 2 minutes at once.

However, AutoGen will give you an option to further refine your goals with the following prompt. And, developers have the option to provide their best feedback based on the previous demo, which is as follows –

I want to place the snake within the boundary of the visual wall & it should bounce each wall & then hit the target. And, it should increase the size. And, every time when it hits the target it will increase the score by 10. And, the application will run for 2 minutes, which will be displayed on the screen. This will exit once 2 minute is over.

And, the output of this change is per our expectations, which is shown below –


We’ll further analyze the prompt engineering & the final generated code in the next post.

2 thoughts on “Building solutions using LLM AutoGen in Python – Part 2

Leave a Reply