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

Deriving the customer's language

Now that you have a transcript of the customer call, you need to derive the language used to eventually translate the response back to the customer in their native language. You'll use an OpenAI chat model to identify the language.

The output from the model should be standardized to a country code; for example, "en" for English, "fr" for French, and so on.

The transcript you created in the previous exercise is available as transcript.

Bu egzersiz

Multi-Modal Systems with the OpenAI API

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

Egzersiz talimatları

  • Prompt gpt-4o-mini to consider the transcript and return the country code of the language being used, e.g., "en" for English and "fr" for French.
  • Extract the country code from response.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

client = OpenAI(api_key="")

# Complete a request identify the country code from the transcript
response = ____

# Extract the country code from the response
country_code = ____
print(country_code)
Kodu Düzenle ve Çalıştır