Getting and Processing LLM Completions for the Game
Introduction: Why We Need LLM Completion in Our Game
Welcome back! In the previous lessons, you learned how to generate and select daily prompts for the LLM Prediction Game. Now, we are ready to take the next step: getting a response from the Large Language Model (LLM) itself.
The LLM is the "brain" of our game. It takes the prompt and user question, then generates a response. In our game, players will try to guess the next word the LLM will produce. To make this possible, we need to know exactly what the LLM would say in response to a prompt. This lesson will show you how to send a prompt to the LLM, get its response, and prepare that response for use in the game.
Quick Recap: Where We Are in the Project
Just as a reminder, you have already learned how to:
- Create and store prompt data for the game. (
prompt_generator.pyanddata.json) - Select the correct daily prompt using the current date. (
game.py)
Lets also remember the structure of the project:
Now, with a daily prompt ready, our next task is to send this prompt to the LLM and get its response. This response will be used as the "answer" for the day's game. All this functionality will be contained in the llm.py file.
