始める無料で始める

Content generation

AI is playing a much greater role in content generation, from creating marketing content such as blog post titles to creating outreach email templates for sales teams.

In this exercise, you'll harness AI to generate a catchy slogan for a new restaurant. Feel free to test out different prompts, such as varying the type of cuisine (Italian, Chinese, etc.) or the type of restaurant (fine-dining, fast-food, etc.), to see how the response changes.

この演習はコースの一部です

Working with DeepSeek in Python

コースを見る

演習の手順

  • Create a request to create a slogan for a new restaurant; set the maximum number of tokens to 10.

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

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

# Create a request to the chat model
response = client.chat.completions.create(
  model="deepseek-ai/DeepSeek-V4-Pro",
  messages=[{"role": "user", "content": "____"}],
  ____
)

print(response.choices[0].message.content)
コードを編集して実行