Congratulations!

Working with DeepSeek in Python

James Chapman

Curriculum Manager, DataCamp

Chapter 1

 

  • Creating requests for DeepSeek's chat and reasoning models

The DeepSeek logo.

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)
Working with DeepSeek in Python

Chapter 2

response = client.chat.completions.create(
  model="deepseek-ai/DeepSeek-V3",
  messages=[{"role": "user", "content": "..."}],
  max_tokens=20,
  temperature=0.5
)
  • Q&A
  • Text transformation
  • Content generation
  • Categorization, e.g., sentiment analysis
  • Code debugging
  • max_tokens and temperature

Different DeepSeek model applications.

Working with DeepSeek in Python

Chapter 3

 

  • "system"

    • Steer model outputs
    • Add guardrails
  • "assistant"

    • Structured few-shot prompting
    • Build a conversation history

The three roles in a chat interaction: the system, the user, and the assistant.

Working with DeepSeek in Python

What next?

Working with DeepSeek in Python

Let's practice!

Working with DeepSeek in Python

Preparing Video For Download...