passdrill
AI & LLM Engineering · Prompt Engineering · Card 027/027 easy

A developer is building an application on OpenAI's Chat Completions API and needs to send the model both a high-level instruction that should shape its behavior for the whole conversation and the end user's own question. Per OpenAI's API documentation, how should these two pieces of context be structured in the request?

  1. Both pieces of context are sent as a single combined string, since the Chat Completions API has no way to distinguish who authored which part of the input
  2. Only the end user's question can be sent to the model; there is no supported way to give it standing instructions that apply to the whole conversation
  3. The high-level instruction must be repeated inside every individual user message, since a message with a system role is discarded by the API after the first turn
  4. Per OpenAI's API documentation, the request is built as an array of role-tagged messages: the high-level instruction is sent as a system message placed at the start of the array, the end user's question is sent as a user message, and any of the model's own prior responses are represented back to it as assistant messages
Next card → Shuffle