1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Amazon Bedrock

Connected

Exercise

Controlling output with top_p and max_tokens

The marketing team now wants two versions of a story about ChefBot, the flagship cooking robot: a concise briefing for investors and a more creative “behind-the-scenes” blog post.

In this exercise, the boto3 and json libraries, and the bedrock client, have been pre-imported.

Instructions

100 XP
  • Generate a concise story using a low top_p and low max_tokens and a more creative story using a high top_p and high max_tokens, keeping max_tokens to a maximum of 200.