LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Working with the OpenAI Responses API

Kurs anzeigen

Anleitung zur Übung

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

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

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")
Code bearbeiten und ausführen