Courseiva
Prompt EngineeringhardMultiple ChoiceObjective-mapped

1Z0-1127-25 Prompt Engineering Practice Question

A developer is using a Cohere Command model via OCI Generative AI. They want the model to generate responses strictly in JSON format for a specific task, but the model sometimes outputs additional explanatory text. Which prompt engineering technique is MOST effective?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Add a preamble: 'You are a JSON generator. Output only valid JSON. Do not include any other text.'

Using a system prompt to set the persona (e.g., 'You are a JSON generator') and including a step-by-step instruction reduces unwanted text. Cohere's preamble works like a system prompt to enforce constraints.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Include a single example of a JSON output in the user message

    Why it's wrong here

    A single example (few-shot) helps but often not enough to eliminate all extra text; system-level constraints are stronger.

  • Set the temperature to 0.0 to make the model deterministic

    Why it's wrong here

    Low temperature reduces randomness but does not guarantee strict JSON output; the model may still include explanations.

  • Use a stop sequence '}' to force the model to stop after the JSON

    Why it's wrong here

    Stop sequences can help but are fragile; the model might not always end with '}' if it inserts text before or after.

  • Add a preamble: 'You are a JSON generator. Output only valid JSON. Do not include any other text.'

    Why this is correct

    The preamble acts as a system prompt, setting the role and strict output constraint. Combined with explicit instructions, this effectively suppresses extra text.

About these practice questions

Courseiva writes every 1Z0-1127-25 question from scratch — 768 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 1Z0-1127-25 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-1127-25 exam.