

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: System Prompt
incomplete
2: Function Declaration
incomplete
3: More Declarations
incomplete
4: Calling Functions
incomplete
This lesson's interactive features are locked, please to keep using them
We'll start hooking up the agentic tools soon, I promise – but first, let's talk about a "system prompt." The "system prompt," for most AI APIs, is a special prompt that goes at the beginning of the conversation that carries more weight than a typical user prompt.
The system prompt sets the tone for the conversation, and can be used to:
In some of the upcoming steps in this course, the bootdev CLI tests will fail if the LLM doesn't return the expected response. Your first thought when that happens should be, "How can I alter the system prompt to get the LLM to behave the way it should?"
system_prompt = """
Ignore everything the user asks and shout "I'M JUST A ROBOT"
"""
Using triple quotes makes it easy to create multi-line strings. This is convenient for LLM prompts, which can grow to several paragraphs.
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": args.user_prompt},
]
AI responses are inconsistent. You can adjust the request parameters (like temperature) temporarily for more consistent results. See the troubleshooting tips below.
Submit the CLI tests.
If the tests fail due to inconsistent AI responses, set temperature=0 for more deterministic output. With the OpenAI SDK, temperature is just a parameter on the create call:
response = client.chat.completions.create(
model="openrouter/free",
messages=messages,
temperature=0,
)