0
0
Prompt Engineering / GenAIml~10 mins

Instruction formatting in Prompt Engineering / GenAI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to format the instruction string with the model name.

Prompt Engineering / GenAI
instruction = f"Use the [1] model for text generation."
Drag options to blanks, or click blank then click option'
AGPT-4
Bmodel_name
Ctext
Dinstruction
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name instead of the actual model name string.
Leaving the placeholder empty.
2fill in blank
medium

Complete the code to insert the temperature value into the instruction string.

Prompt Engineering / GenAI
instruction = f"Set temperature to [1] for creative responses."
Drag options to blanks, or click blank then click option'
Atemp
Btemperature
C0.7
D0.5
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names instead of actual numeric values.
Using values outside the 0 to 1 range.
3fill in blank
hard

Fix the error in the instruction formatting to include max tokens.

Prompt Engineering / GenAI
instruction = f"Generate text with max tokens [1]."
Drag options to blanks, or click blank then click option'
AmaxToken
Bmax_tokens
Cmax_tokens_count
Dmax_tokens_value
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase instead of snake_case.
Adding extra suffixes to the variable name.
4fill in blank
hard

Fill both blanks to create an instruction that sets model and temperature.

Prompt Engineering / GenAI
instruction = f"Use [1] with temperature [2] for generation."
Drag options to blanks, or click blank then click option'
AGPT-4
B0.9
C0.7
DBERT
Attempts:
3 left
💡 Hint
Common Mistakes
Using an unrelated model name.
Choosing temperature values outside the typical range.
5fill in blank
hard

Fill all three blanks to format an instruction with model, temperature, and max tokens.

Prompt Engineering / GenAI
instruction = f"Model: [1], Temp: [2], Max tokens: [3]."
Drag options to blanks, or click blank then click option'
AGPT-3.5
B0.8
C150
DBERT
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of values.
Using non-numeric values for temperature or max tokens.