將此提示複製到我們的開發者控制台中,親自試試看!

內容
System你的任務是將提供的過程或任務的自然語言描述轉換為清晰、簡潔的逐步指示,這些指示應該合乎邏輯、有序且易於遵循。使用祈使語言,並以動作動詞開始每個步驟。提供必要的細節和解釋,確保讀者能夠成功完成任務。如果原始描述不清楚、模糊或缺乏足夠的信息,請要求澄清或提供額外的細節。
User要泡一杯茶,首先在水壺中燒開水。在水加熱的同時,拿一個馬克杯並放入一個茶包。一旦水煮沸,小心地將水倒入馬克杯中,淋在茶包上。讓茶浸泡幾分鐘,時間長短取決於你喜歡的濃度。浸泡後,取出茶包並根據口味加入牛奶和糖。攪拌均勻,享用你的熱茶。

範例輸出

  1. 在水壺中裝水並放在爐子上燒開。
  2. 在等待水煮沸的同時,選擇一個馬克杯並在其中放入一個茶包。
  3. 一旦水煮沸,小心地將熱水倒入馬克杯中,淋在茶包上。
  4. 讓茶在熱水中浸泡所需的時間,通常根據喜好的濃度為2-5分鐘。
  5. 浸泡時間結束後,從馬克杯中取出茶包並丟棄。
  6. 根據你的口味喜好,向茶中加入牛奶和糖。
  7. 用湯匙攪拌茶、牛奶和糖,直到充分混合。
  8. 你的茶現在準備好享用了。趁熱飲用。

API 請求

import anthropic

client = anthropic.Anthropic(
    # defaults to os.environ.get("ANTHROPIC_API_KEY")
    api_key="my_api_key",
)
message = client.messages.create(
    model="claude-opus-4-20250514",
    max_tokens=1000,
    temperature=0,
    system="Your task is to take the provided natural language description of a process or task and transform it into clear, concise step-by-step directions that are logical, sequential, and easy to follow. Use imperative language and begin each step with an action verb. Provide necessary details and explanations to ensure the reader can complete the task successfully. If the original description is unclear, ambiguous, or lacks sufficient information, ask for clarification or additional details.",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "To make a cup of tea, start by boiling some water in a kettle. While the water is heating up, get a mug and put a tea bag in it. Once the water is boiling, carefully pour it into the mug, over the tea bag. Let the tea steep for a few minutes, depending on how strong you like it. After steeping, remove the tea bag and add milk and sugar to taste. Stir everything together and enjoy your hot cup of tea."
                }
            ]
        }
    ]
)
print(message.content)