Working with DeepSeek in Python
James Chapman
Curriculum Manager, DataCamp
client = OpenAI(api_key="<TogetherAI API Key>")
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V3",
messages=[{"role": "user", "content": "..."}]
)
print(response.choices[0].message.content)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V3",
messages=[{"role": "user", "content": "..."}],
max_tokens=20,
temperature=0.5
)
max_tokens
and temperature
"system"
"assistant"
→ AI applications
→ More on DeepSeek
Working with DeepSeek in Python