

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Build an AI Agent
incomplete
2: Python Setup
incomplete
3: OpenRouter API
incomplete
4: Token Metadata
incomplete
5: User Input
incomplete
6: Multiple Messages
incomplete
7: Verbose Output
incomplete
This lesson's interactive features are locked, please to keep using them
We've hard-coded the prompt that goes to the LLM, which is... not very useful. Let's update our code to accept the prompt as a command-line argument.
We don't want our users to have to edit the code to change the prompt!
parser = argparse.ArgumentParser(description="Chatbot")
parser.add_argument("user_prompt", type=str, help="User prompt")
args = parser.parse_args()
# Now we can access `args.user_prompt`
uv run main.py "Why are episodes 7-9 so much worse than 1-6? Use one paragraph."
The remainder of the script can remain unchanged for now.
If things seem to be working correctly, submit the CLI tests.