0
0
Prompt Engineering / GenAIml~20 mins

DALL-E API usage in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DALL-E API Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this DALL-E API call?
Given the following Python code snippet using the DALL-E API, what will be the type of the variable response after execution?
Prompt Engineering / GenAI
import openai
response = openai.Image.create(
    prompt="a red apple on a wooden table",
    n=1,
    size="256x256"
)
AA string containing the raw image data
BA dictionary containing image URLs and metadata
CA list of image binary data
DAn integer representing the number of images generated
Attempts:
2 left
💡 Hint
Think about what the API returns when you request images.
Model Choice
intermediate
1:30remaining
Which DALL-E model size option produces the highest resolution images?
You want to generate the largest and most detailed images using the DALL-E API. Which size parameter should you choose?
A"256x256"
B"512x512"
C"128x128"
D"1024x1024"
Attempts:
2 left
💡 Hint
Higher numbers mean bigger images.
Hyperparameter
advanced
2:00remaining
How does changing the n parameter affect the DALL-E API response?
If you set n=3 in the DALL-E API call, what will be the effect on the response?
AThe API returns 3 images merged into one
BThe API returns 1 image repeated 3 times
CThe API returns 3 different images in the response
DThe API returns 3 images but only one URL
Attempts:
2 left
💡 Hint
The parameter n controls how many images you want.
🔧 Debug
advanced
2:30remaining
Why does this DALL-E API call raise an error?
Consider this code snippet: import openai response = openai.Image.create( prompt=12345, n=1, size="256x256" ) Why does this code raise an error?
ABecause the prompt must be a string, not an integer
BBecause the size parameter is invalid
CBecause n must be greater than 1
DBecause the openai module is not imported correctly
Attempts:
2 left
💡 Hint
Check the data type of the prompt parameter.
🧠 Conceptual
expert
3:00remaining
What is the main ethical consideration when using DALL-E generated images?
When generating images with DALL-E, what is a key ethical concern to keep in mind?
AEnsuring images do not infringe on copyrights or create harmful content
BAvoiding the use of descriptive prompts
CUsing the smallest image size to save bandwidth
DMaximizing the number of images generated per request
Attempts:
2 left
💡 Hint
Think about how images might affect others or violate rules.