Lesson 15 of 16
Quiz · 10 min
Choose an answer for each question. Some questions have more than one right answer.
A program classifies the comments of riders. The rules for the labels are the same for each call. Which message holds the rules?
user
system
assistant
rules
Which statements about tokens are true? Choose all that apply.
Choose all answers that apply.
A response has this stop reason. What does it tell you?
response["stop_reason"] # "max_tokens"
max_tokens
A call uses 4,000 input tokens and 1,000 output tokens. The input price is 3 dollars for 1,000,000 tokens, and the output price is 12 dollars for 1,000,000 tokens. What does the call cost?
Why does the model not know the name in the second call?
client.chat([{"role": "user", "content": "My name is Rosa."}]) client.chat([{"role": "user", "content": "What is my name?"}])
A chat program sends the complete history with each call. What happens in a long conversation? Choose all that apply.
A program compares the answer of the model with the text "complaint". Which setting and which step make the comparison reliable?
"complaint"
temperature=1
temperature=0
max_tokens=1
Which instructions give an answer that a program can read with json.loads most reliably?
json.loads
Classify the comment.
Classify the comment. Answer in JSON.
Classify the comment as one of: praise, complaint, question, other. Answer with only JSON. Use the keys "label" and "reason".
Classify the comment, and be careful with the format.
Your program allows the labels praise, complaint, question and other. The model gives this answer. json.loads reads it without an error. What does the program do?
praise
complaint
question
other
{"label": "unclear", "reason": "The comment is short."}
unclear
For which errors can a new try of the same call work? Choose all that apply.
RateLimitError
ServerError
ModelTimeout
AuthError
BadRequestError
A function tries a call up to 4 times. After each failure with a ServerError, it waits for min(2 ** attempt, 30) seconds, and attempt starts at 0. The first three calls fail, and the fourth call works. For how many seconds did the function wait in total?
min(2 ** attempt, 30)
attempt
Where does the API key of a real service belong?
os.environ
A program processes 5,000 comments in a loop, with one call for each comment. Call number 3,200 raises a ServerError, and the loop has no try. What happens?
try
On a test set of 200 comments, a small model gives 172 right labels, and a large model gives 190. The large model costs 12 times more for each call. Which statement is correct?
Answer every question to check.