共同で問題解決
新しい製造ワークショップの開始が迫る中、Aurora の参加登録サイトのページ読み込みに 8〜10 秒かかるようになり、参加希望者の離脱リスクが生じています。あなたは、Claude との再度のマルチターン会話を通して問題を解決することにしました。まずページの遅延を報告し、次に詳細情報を追加して Claude がボトルネックを特定できるようにしましょう。
anthropic ライブラリと client はあらかじめ読み込まれています。
この演習はコースの一部です
Claude モデル入門
演習の手順
- 最初の問題、
"My website loads slowly, taking 8-10 seconds"を報告してください。 - 追加の詳細情報として
"The slowdown happens only on the homepage with the image gallery"を提供してください。 - 2 回目の API 呼び出しに messages パラメータを追加してください。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
messages = []
# Add initial problem report
messages.append({"role": "user", "content": ____})
response1 = client.messages.create(model="claude-sonnet-4-6", max_tokens=150, messages=messages)
# Simulate Claude asking follow-up questions, then provide more details
messages.append({"role": "assistant", "content": response1.content[0].text})
messages.append({"role": "user", "content": ____})
# Get final troubleshooting advice
response2 = client.messages.create(model="claude-sonnet-4-6", max_tokens=200, ____)