CommencerCommencer gratuitement

Reasoning About Reasoning

Now you've experimented with the different models available, let's try out the two other parameters introduced in the video: reasoning and max_output_tokens.

Here's the challenge:

  • Find the correct answer to the question: How many of the letter 's' are in the sentence, 'Mississippi are possessive over their successes?' using an LLM. Spoiler: the answer is 12.
  • The code must run in under 8 seconds!

You can use any model out of the options: gpt-5-nano, gpt-5-mini, and gpt-5.

Cet exercice fait partie du cours

Working with the OpenAI Responses API

Afficher le cours

Instructions

  • Complete the challenge by correctly finding the answer to the prompt provided, and in under 8 seconds!

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

start_time = time.time()
prompt = "How many of the letter 's' are in the sentence, 'Mississippi are possessive over their successes?'"

# Complete the challenge!
response = client.responses.create(
    ____
)

runtime = time.time() - start_time

print(response.output_text)
print(f"\nRuntime: {runtime:.2f} seconds")
Modifier et exécuter le code