diff --git a/AmazonBedrock/README.md b/AmazonBedrock/README.md index ccb51c6..4284055 100644 --- a/AmazonBedrock/README.md +++ b/AmazonBedrock/README.md @@ -5,20 +5,40 @@ This course is intended to provide you with a comprehensive step-by-step understanding of how to engineer optimal prompts within Claude, using Bedrock. **After completing this course, you will be able to**: -- Master the basic structure of a good prompt +- Master the basic structure of a good prompt - Recognize common failure modes and learn the '80/20' techniques to address them - Understand Claude's strengths and weaknesses - Build strong prompts from scratch for common use cases +## Quick start + +Choose one Bedrock track, then work through the notebooks in order: + +### Anthropic Bedrock SDK track +1. [anthropic/00_Tutorial_How-To.ipynb]() +2. [anthropic/01_Basic_Prompt_Structure.ipynb]() +3. Continue chapter-by-chapter through the rest of `AmazonBedrock/anthropic/` + +### boto3 track +1. [boto3/00_Tutorial_How-To.ipynb]() +2. [boto3/01_Basic_Prompt_Structure.ipynb]() +3. Continue chapter-by-chapter through the rest of `AmazonBedrock/boto3/` + +Install the Python dependencies first: + +```bash +pip install -r requirements.txt +``` + ## Course structure and content -This course is structured to allow you many chances to practice writing and troubleshooting prompts yourself. The course is broken up into **9 chapters with accompanying exercises**, as well as an appendix of even more advanced methods. It is intended for you to **work through the course in chapter order**. +This course is structured to allow you many chances to practice writing and troubleshooting prompts yourself. The course is broken up into **9 chapters with accompanying exercises**, as well as an appendix of even more advanced methods. It is intended for you to **work through the course in chapter order**. **Each lesson has an "Example Playground" area** at the bottom where you are free to experiment with the examples in the lesson and see for yourself how changing prompts can change Claude's responses. There is also an [answer key](https://docs.google.com/spreadsheets/d/1jIxjzUWG-6xBVIa2ay6yDpLyeuOh_hR_ZB75a47KX_E/edit?usp=sharing). While this answer key is structured for 1P API requests, the solutions are the same. -Note: This tutorial uses our smallest, fastest, and cheapest model, Claude 3 Haiku. Anthropic has [two other models](https://docs.anthropic.com/claude/docs/models-overview), Claude 3 Sonnet and Claude 3 Opus, which are more intelligent than Haiku, with Opus being the most intelligent. +Note: This tutorial uses our smallest, fastest, and cheapest model, Claude 3 Haiku. Anthropic has [two other models](https://docs.anthropic.com/en/docs/about-claude/models/overview), Claude 3 Sonnet and Claude 3 Opus, which are more intelligent than Haiku, with Opus being the most intelligent. -When you are ready to begin, go to `01_Basic Prompt Structure` to proceed. +When you are ready to begin, open one of the `01_Basic_Prompt_Structure.ipynb` notebooks above. If you have not configured your environment yet, start with the matching `00_Tutorial_How-To.ipynb` notebook first. ## Table of Contents @@ -26,23 +46,17 @@ Each chapter consists of a lesson and a set of exercises. ### Beginner - **Chapter 1:** Basic Prompt Structure - -- **Chapter 2:** Being Clear and Direct - +- **Chapter 2:** Being Clear and Direct - **Chapter 3:** Assigning Roles -### Intermediate +### Intermediate - **Chapter 4:** Separating Data from Instructions - - **Chapter 5:** Formatting Output & Speaking for Claude - - **Chapter 6:** Precognition (Thinking Step by Step) - - **Chapter 7:** Using Examples ### Advanced - **Chapter 8:** Avoiding Hallucinations - - **Chapter 9:** Building Complex Prompts (Industry Use Cases) - Complex Prompts from Scratch - Chatbot - Complex Prompts for Legal Services @@ -53,5 +67,5 @@ Each chapter consists of a lesson and a set of exercises. - **Appendix:** Beyond Standard Prompting - Chaining Prompts - Tool Use - - Empriical Performance Evaluations - - Search & Retrieval \ No newline at end of file + - Empirical Performance Evaluations + - Search & Retrieval diff --git a/README.md b/README.md index d99c4d5..a2c6f48 100644 --- a/README.md +++ b/README.md @@ -5,47 +5,55 @@ This course is intended to provide you with a comprehensive step-by-step understanding of how to engineer optimal prompts within Claude. **After completing this course, you will be able to**: -- Master the basic structure of a good prompt +- Master the basic structure of a good prompt - Recognize common failure modes and learn the '80/20' techniques to address them - Understand Claude's strengths and weaknesses - Build strong prompts from scratch for common use cases +## Quick start + +If you are new to the repo, start with these notebooks in order: + +1. [00_Tutorial_How-To.ipynb]() +2. [01_Basic_Prompt_Structure.ipynb]() +3. Continue chapter-by-chapter through the rest of the `Anthropic 1P/` folder + +You can open the notebooks in JupyterLab, VS Code, or Google Colab after uploading them there. + +If you want the Bedrock version instead, use [AmazonBedrock/README.md]() and start with either: +- [AmazonBedrock/anthropic/00_Tutorial_How-To.ipynb]() +- [AmazonBedrock/boto3/00_Tutorial_How-To.ipynb]() + ## Course structure and content -This course is structured to allow you many chances to practice writing and troubleshooting prompts yourself. The course is broken up into **9 chapters with accompanying exercises**, as well as an appendix of even more advanced methods. It is intended for you to **work through the course in chapter order**. +This course is structured to allow you many chances to practice writing and troubleshooting prompts yourself. The course is broken up into **9 chapters with accompanying exercises**, as well as an appendix of even more advanced methods. It is intended for you to **work through the course in chapter order**. **Each lesson has an "Example Playground" area** at the bottom where you are free to experiment with the examples in the lesson and see for yourself how changing prompts can change Claude's responses. There is also an [answer key](https://docs.google.com/spreadsheets/d/1jIxjzUWG-6xBVIa2ay6yDpLyeuOh_hR_ZB75a47KX_E/edit?usp=sharing). -Note: This tutorial uses our smallest, fastest, and cheapest model, Claude 3 Haiku. Anthropic has [two other models](https://docs.anthropic.com/claude/docs/models-overview), Claude 3 Sonnet and Claude 3 Opus, which are more intelligent than Haiku, with Opus being the most intelligent. +Note: This tutorial uses our smallest, fastest, and cheapest model, Claude 3 Haiku. Anthropic has [two other models](https://docs.anthropic.com/en/docs/about-claude/models/overview), Claude 3 Sonnet and Claude 3 Opus, which are more intelligent than Haiku, with Opus being the most intelligent. *This tutorial also exists on [Google Sheets using Anthropic's Claude for Sheets extension](https://docs.google.com/spreadsheets/d/19jzLgRruG9kjUQNKtCg1ZjdD6l6weA6qRXG5zLIAhC8/edit?usp=sharing). We recommend using that version as it is more user friendly.* -When you are ready to begin, go to `01_Basic Prompt Structure` to proceed. +When you are ready to begin, open [01_Basic_Prompt_Structure.ipynb](). If you have not set up your environment yet, start with [00_Tutorial_How-To.ipynb]() first. ## Table of Contents Each chapter consists of a lesson and a set of exercises. ### Beginner -- **Chapter 1:** Basic Prompt Structure - -- **Chapter 2:** Being Clear and Direct +- **Chapter 1:** [Basic Prompt Structure]() +- **Chapter 2:** [Being Clear and Direct]() +- **Chapter 3:** [Assigning Roles]() -- **Chapter 3:** Assigning Roles - -### Intermediate -- **Chapter 4:** Separating Data from Instructions - -- **Chapter 5:** Formatting Output & Speaking for Claude - -- **Chapter 6:** Precognition (Thinking Step by Step) - -- **Chapter 7:** Using Examples +### Intermediate +- **Chapter 4:** [Separating Data from Instructions]() +- **Chapter 5:** [Formatting Output & Speaking for Claude]() +- **Chapter 6:** [Precognition (Thinking Step by Step)]() +- **Chapter 7:** [Using Examples]() ### Advanced -- **Chapter 8:** Avoiding Hallucinations - -- **Chapter 9:** Building Complex Prompts (Industry Use Cases) +- **Chapter 8:** [Avoiding Hallucinations]() +- **Chapter 9:** [Building Complex Prompts (Industry Use Cases)]() - Complex Prompts from Scratch - Chatbot - Complex Prompts for Legal Services - **Exercise:** Complex Prompts for Financial Services @@ -53,6 +61,6 @@ Each chapter consists of a lesson and a set of exercises. - Congratulations & Next Steps - **Appendix:** Beyond Standard Prompting - - Chaining Prompts - - Tool Use - - Search & Retrieval \ No newline at end of file + - [Chaining Prompts]() + - [Tool Use]() + - [Search & Retrieval]() diff --git a/scripts/check_readme_tutorial_links.py b/scripts/check_readme_tutorial_links.py new file mode 100644 index 0000000..556acff --- /dev/null +++ b/scripts/check_readme_tutorial_links.py @@ -0,0 +1,28 @@ +from pathlib import Path +import re + +REPO_ROOT = Path(__file__).resolve().parents[1] +README_PATHS = [ + REPO_ROOT / "README.md", + REPO_ROOT / "AmazonBedrock" / "README.md", +] +LINK_RE = re.compile(r"\[[^\]]+\]\(<([^>]+)>\)") + + +def main() -> None: + missing = [] + for readme in README_PATHS: + content = readme.read_text(encoding="utf-8") + for rel_path in LINK_RE.findall(content): + target = (readme.parent / rel_path).resolve() + if not target.exists(): + missing.append(f"{readme.relative_to(REPO_ROOT)} -> {rel_path}") + + if missing: + raise SystemExit("Broken README tutorial links:\n" + "\n".join(missing)) + + print("README tutorial links OK") + + +if __name__ == "__main__": + main()