Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions AmazonBedrock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,58 @@
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](<anthropic/00_Tutorial_How-To.ipynb>)
2. [anthropic/01_Basic_Prompt_Structure.ipynb](<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](<boto3/00_Tutorial_How-To.ipynb>)
2. [boto3/01_Basic_Prompt_Structure.ipynb](<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

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
Expand All @@ -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
- Empirical Performance Evaluations
- Search & Retrieval
54 changes: 31 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,62 @@
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](<Anthropic 1P/00_Tutorial_How-To.ipynb>)
2. [01_Basic_Prompt_Structure.ipynb](<Anthropic 1P/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](<AmazonBedrock/README.md>) and start with either:
- [AmazonBedrock/anthropic/00_Tutorial_How-To.ipynb](<AmazonBedrock/anthropic/00_Tutorial_How-To.ipynb>)
- [AmazonBedrock/boto3/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](<Anthropic 1P/01_Basic_Prompt_Structure.ipynb>). If you have not set up your environment yet, start with [00_Tutorial_How-To.ipynb](<Anthropic 1P/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](<Anthropic 1P/01_Basic_Prompt_Structure.ipynb>)
- **Chapter 2:** [Being Clear and Direct](<Anthropic 1P/02_Being_Clear_and_Direct.ipynb>)
- **Chapter 3:** [Assigning Roles](<Anthropic 1P/03_Assigning_Roles_Role_Prompting.ipynb>)

- **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](<Anthropic 1P/04_Separating_Data_and_Instructions.ipynb>)
- **Chapter 5:** [Formatting Output & Speaking for Claude](<Anthropic 1P/05_Formatting_Output_and_Speaking_for_Claude.ipynb>)
- **Chapter 6:** [Precognition (Thinking Step by Step)](<Anthropic 1P/06_Precognition_Thinking_Step_by_Step.ipynb>)
- **Chapter 7:** [Using Examples](<Anthropic 1P/07_Using_Examples_Few-Shot_Prompting.ipynb>)

### Advanced
- **Chapter 8:** Avoiding Hallucinations

- **Chapter 9:** Building Complex Prompts (Industry Use Cases)
- **Chapter 8:** [Avoiding Hallucinations](<Anthropic 1P/08_Avoiding_Hallucinations.ipynb>)
- **Chapter 9:** [Building Complex Prompts (Industry Use Cases)](<Anthropic 1P/09_Complex_Prompts_from_Scratch.ipynb>)
- Complex Prompts from Scratch - Chatbot
- Complex Prompts for Legal Services
- **Exercise:** Complex Prompts for Financial Services
- **Exercise:** Complex Prompts for Coding
- Congratulations & Next Steps

- **Appendix:** Beyond Standard Prompting
- Chaining Prompts
- Tool Use
- Search & Retrieval
- [Chaining Prompts](<Anthropic 1P/10.1_Appendix_Chaining Prompts.ipynb>)
- [Tool Use](<Anthropic 1P/10.2_Appendix_Tool Use.ipynb>)
- [Search & Retrieval](<Anthropic 1P/10.3_Appendix_Search & Retrieval.ipynb>)
28 changes: 28 additions & 0 deletions scripts/check_readme_tutorial_links.py
Original file line number Diff line number Diff line change
@@ -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()