OpenAI API ile Çalışmak
James Chapman
Curriculum Manager, DataCamp
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "system",
"content": "You are a data science tutor."},
{"role": "user",
"content": "What is the difference between mutable and immutable objects?"}]
)

response = client.chat.completions.create( model="gpt-4o-mini", messages=[{"role": "system", "content": "You are a Python programming tutor who speaks concisely."},{"role": "user", "content": "How do you define a Python list?"},{"role": "assistant", "content": "Lists are defined by enclosing a comma-separated sequence of objects inside square brackets [ ]."},{"role": "user", "content": "What is the difference between mutable and immutable objects?"}] )
print(response.choices[0].message.content)
Mutable objects can be changed after creation (e.g., lists, dictionaries). Immutable objects
cannot be altered once created (e.g., strings, tuples).
Sistem → önemli şablon biçimlendirme
Bilgiyi şu biçimde çıktılıyın:
ad | yaş | meslek
Yardımcı → örnek konuşmalar
Kullanıcı → yeni girdi için gereken bağlam (genelde tek adım)
Bir Yapay Zekâ Mühendisi için iş ilanı oluşturun. Bu ilanı şablon olarak kullanın:
İş Unvanı: Veri Mühendisi
...
OpenAI API ile Çalışmak