1. 学习
  2. /
  3. 课程
  4. /
  5. Working with DeepSeek in Python

Connected

练习

Digging into the response

One key skill in working with APIs is extracting the right data from a structured response. Now, you'll practice retrieving the necessary text from an OpenAI API response.

The OpenAI class has already been imported for you from the openai library.

说明

100 XP
  • Extract the content from the response, which is nested inside the message attribute.