Skip to main content
πŸ€– Learn AI: Build with LLMs

System Prompts & Requests

A system prompt sets persistent behavior/persona for the whole conversation. A request to an LLM API bundles the model name, the system prompt, the messages, and sampling settings like temperature (higher = more creative/random).

Your task

Write buildRequest(system, messages) that returns an object:

{
  model: "claude-opus-4-8",
  system: system,
  messages: messages,
  temperature: 0.7
}

Use exactly those keys and that default temperature.

⚑ 35 XP
solution.jsRuns in your browser
Loading editor…
Tests1 to pass
assembles the request

Run your code to check these.