BaşlayınÜcretsiz Başlayın

Combining LLMs and Web Search

You're building a travel assistant chatbot that needs to provide current weather information to users planning their trips. The LLM you're using has a knowledge cutoff from several months ago, so it cannot access real-time weather data without additional tools.

Bu egzersiz

Working with the OpenAI Responses API

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Create a request to the 'gpt-5-mini' model asking for the current temperature in Berlin, Germany with the 'web_search' tool enabled.
  • Print the text output from the response.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create a response with web search enabled
response = client.responses.create(
    model="____",
    tools=____,
    input="What is the current temperature in Berlin, Germany?"
)

# Print the output text
print(____)
Kodu Düzenle ve Çalıştır