Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select the GPT-4 model for generating text.
Prompt Engineering / GenAI
model = "[1]"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'gpt-3.5-turbo' instead of 'gpt-4'.
Using older model names like 'davinci' or 'curie'.
✗ Incorrect
The GPT-4 model is selected by setting the model string to "gpt-4".
2fill in blank
mediumComplete the code to set the temperature parameter for more creative responses.
Prompt Engineering / GenAI
response = openai.ChatCompletion.create(model="gpt-4", temperature=[1], messages=messages)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a temperature like 1.5, which produces overly random output.
Setting temperature to 0.0, which makes output very deterministic.
✗ Incorrect
A temperature of 0.7 encourages creativity without being too random.
3fill in blank
hardFix the error in the code to correctly select GPT-3.5 model.
Prompt Engineering / GenAI
model_name = "[1]"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'gpt-4' instead of GPT-3.5.
Using older names like 'text-davinci-003'.
✗ Incorrect
The correct model name for GPT-3.5 is 'gpt-3.5-turbo'.
4fill in blank
hardFill both blanks to create a dictionary with model and max tokens for GPT-4.
Prompt Engineering / GenAI
config = {"model": "[1]", "max_tokens": [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using GPT-3.5 model name with GPT-4 max tokens.
Setting max tokens too low for GPT-4.
✗ Incorrect
GPT-4 supports max_tokens up to 8192, so model is 'gpt-4' and max_tokens is 8192.
5fill in blank
hardFill all three blanks to create a request with GPT-3.5, temperature 0.5, and max tokens 4096.
Prompt Engineering / GenAI
response = openai.ChatCompletion.create(model="[1]", temperature=[2], max_tokens=[3], messages=messages)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using GPT-4 model name instead of GPT-3.5.
Setting temperature too high or too low.
Using max tokens not supported by GPT-3.5.
✗ Incorrect
The request uses GPT-3.5 model 'gpt-3.5-turbo', temperature 0.5 for moderate creativity, and max_tokens 4096.