Aan de slagGa gratis aan de slag

Generating a product description

Imagine you're writing marketing copy for SonicPro headphones. Your goal is to generate a persuasive product description using DeepSeek.

Test how different prompting techniques, response lengths, and temperature settings influence the output!

Deze oefening maakt deel uit van de cursus

Working with DeepSeek in Python

Cursus bekijken

Oefeninstructies

  • Create a detailed prompt to generate a product description for SonicPro headphones, including:
    • Active noise cancellation (ANC)
    • 40-hour battery life
    • Foldable design
  • Experiment with max_tokens and temperature settings to see how they affect the output.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

client = OpenAI(api_key="", base_url="https://api.together.xyz/v1")

# Create a detailed prompt
prompt = """
____
"""

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V3",
    messages=[{"role": "user", "content": prompt}],
    # Experiment with max_tokens and temperature settings
    max_tokens=____,
    temperature=____
)

print(response.choices[0].message.content)
Code bewerken en uitvoeren