MulaiMulai sekarang secara gratis

From One Message to Another

Time for you to begin chaining responses together to retain context between requests! This is, in effect, creating a conversation history—a key part of conversations.

Latihan ini adalah bagian dari kursus

Working with the OpenAI Responses API

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Create the first request
response1 = client.____.____(
    model="gpt-5-mini",
    ____="Draft a short LinkedIn post announcing that I'm learning about the OpenAI Responses API to upskill in AI engineering on DataCamp!",
    reasoning={"effort": "minimal"}
)

# Extract the ID from response1
conversation_id = ____
print("Initial post:", response1.output_text)
Edit dan Jalankan Kode