Inspiration

I was curious to see if an LLM could successfully play a logical game such as checkers. And result is that can but it struggles sometimes.

What it does

A user plays checkers with Gemini on a webpage. Gemini generates its move by receiving a text representation of the board after the user has played. Then this is sent to the webpage for rendering.

How we built it

For the front end, I used vanilla Javascript, CSS and SASS. For the backend, I used Python and the langchain framework. And for the API calls I used fastAPI.

Challenges we ran into

I'm a back-end engineer, so doing front-end work was a bit of a challenge. I had to look at numerous examples online and I also use Gemini. Also, there might be some front-end bugs.

Also devising the best prompt for Gemini, I had to have a prompt that would return an output in the same format every time.

Sometimes I usually got this error: Retrying langchain_google_genai.chat_models._chat_with_retry.<locals>._chat_with_retry in 4.0 seconds as it raised ResourceExhausted: 429 Resource has been exhausted (e.g. check quota)... This slowed the game considerably.

Accomplishments that we're proud of

The experiment kinda worked

What we learned

Prompt engineering is hard and I need to learn front-end framework.

What's next for play-game-with-gemini

Add more games.

Built With

Share this project:

Updates