From d85aadedff3238e6ad0c9527a7c715ea0bd8601e Mon Sep 17 00:00:00 2001 From: connameng Date: Thu, 28 Aug 2025 15:29:12 -0600 Subject: [PATCH 1/2] Update tutorial content for accuracy and clarity - Fix outdated user/assistant message alternation instructions in basic prompt structure - Update system prompts documentation link to current URL - Correct temperature parameters link in hallucinations chapter - Modernize tool use explanations to reflect current API capabilities - Fix various spelling errors throughout the documentation - Update model names to latest versions (Claude 3.5 Sonnet) --- AmazonBedrock/README.md | 2 +- Anthropic 1P/01_Basic_Prompt_Structure.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AmazonBedrock/README.md b/AmazonBedrock/README.md index ccb51c6..5fb1570 100644 --- a/AmazonBedrock/README.md +++ b/AmazonBedrock/README.md @@ -53,5 +53,5 @@ Each chapter consists of a lesson and a set of exercises. - **Appendix:** Beyond Standard Prompting - Chaining Prompts - Tool Use - - Empriical Performance Evaluations + - Empirical Performance Evaluations - Search & Retrieval \ No newline at end of file diff --git a/Anthropic 1P/01_Basic_Prompt_Structure.ipynb b/Anthropic 1P/01_Basic_Prompt_Structure.ipynb index 625c8e6..0f73259 100644 --- a/Anthropic 1P/01_Basic_Prompt_Structure.ipynb +++ b/Anthropic 1P/01_Basic_Prompt_Structure.ipynb @@ -219,7 +219,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Why use a system prompt? A **well-written system prompt can improve Claude's performance** in a variety of ways, such as increasing Claude's ability to follow rules and instructions. For more information, visit our documentation on [how to use system prompts](https://docs.anthropic.com/claude/docs/how-to-use-system-prompts) with Claude.\n", + "Why use a system prompt? A **well-written system prompt can improve Claude's performance** in a variety of ways, such as increasing Claude's ability to follow rules and instructions. For more information, visit our documentation on [how to use system prompts](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/system-prompts) with Claude.\n", "\n", "Now we'll dive into some exercises. If you would like to experiment with the lesson prompts without changing any content above, scroll all the way to the bottom of the lesson notebook to visit the [**Example Playground**](#example-playground)." ] From be4f6bab7b7b22c6a5673835bad9f922cf973232 Mon Sep 17 00:00:00 2001 From: connameng Date: Thu, 28 Aug 2025 15:42:29 -0600 Subject: [PATCH 2/2] Add remaining tutorial improvements - Update user/assistant message instructions across all Basic Prompt Structure files - Modernize tool use explanations in Anthropic 1P notebook - Update model to Claude 3.5 Sonnet latest version - Fix outdated API information to reflect current capabilities --- .../anthropic/01_Basic_Prompt_Structure.ipynb | 2 +- AmazonBedrock/boto3/01_Basic_Prompt_Structure.ipynb | 2 +- Anthropic 1P/01_Basic_Prompt_Structure.ipynb | 2 +- Anthropic 1P/10.2_Appendix_Tool Use.ipynb | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AmazonBedrock/anthropic/01_Basic_Prompt_Structure.ipynb b/AmazonBedrock/anthropic/01_Basic_Prompt_Structure.ipynb index 2b9190c..b2e09f6 100755 --- a/AmazonBedrock/anthropic/01_Basic_Prompt_Structure.ipynb +++ b/AmazonBedrock/anthropic/01_Basic_Prompt_Structure.ipynb @@ -201,7 +201,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "`user` and `assistant` messages **MUST alternate**, and messages **MUST start with a `user` turn**. You can have multiple `user` & `assistant` pairs in a prompt (as if simulating a multi-turn conversation). You can also put words into a terminal `assistant` message for Claude to continue from where you left off (more on that in later chapters).\n", + "While the traditional approach of alternating `user` and `assistant` messages is still recommended for optimal conversation flow, consecutive user messages are now allowed and will work. Messages should still start with a `user` turn. You can have multiple `user` & `assistant` pairs in a prompt (as if simulating a multi-turn conversation). You can also put words into a terminal `assistant` message for Claude to continue from where you left off (more on that in later chapters).\n", "\n", "#### System Prompts\n", "\n", diff --git a/AmazonBedrock/boto3/01_Basic_Prompt_Structure.ipynb b/AmazonBedrock/boto3/01_Basic_Prompt_Structure.ipynb index bcb43de..8b0a7e1 100755 --- a/AmazonBedrock/boto3/01_Basic_Prompt_Structure.ipynb +++ b/AmazonBedrock/boto3/01_Basic_Prompt_Structure.ipynb @@ -215,7 +215,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "`user` and `assistant` messages **MUST alternate**, and messages **MUST start with a `user` turn**. You can have multiple `user` & `assistant` pairs in a prompt (as if simulating a multi-turn conversation). You can also put words into a terminal `assistant` message for Claude to continue from where you left off (more on that in later chapters).\n", + "While the traditional approach of alternating `user` and `assistant` messages is still recommended for optimal conversation flow, consecutive user messages are now allowed and will work. Messages should still start with a `user` turn. You can have multiple `user` & `assistant` pairs in a prompt (as if simulating a multi-turn conversation). You can also put words into a terminal `assistant` message for Claude to continue from where you left off (more on that in later chapters).\n", "\n", "#### System Prompts\n", "\n", diff --git a/Anthropic 1P/01_Basic_Prompt_Structure.ipynb b/Anthropic 1P/01_Basic_Prompt_Structure.ipynb index 0f73259..1c702dc 100644 --- a/Anthropic 1P/01_Basic_Prompt_Structure.ipynb +++ b/Anthropic 1P/01_Basic_Prompt_Structure.ipynb @@ -181,7 +181,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "`user` and `assistant` messages **MUST alternate**, and messages **MUST start with a `user` turn**. You can have multiple `user` & `assistant` pairs in a prompt (as if simulating a multi-turn conversation). You can also put words into a terminal `assistant` message for Claude to continue from where you left off (more on that in later chapters).\n", + "While the traditional approach of alternating `user` and `assistant` messages is still recommended for optimal conversation flow, consecutive user messages are now allowed and will work. Messages should still start with a `user` turn. You can have multiple `user` & `assistant` pairs in a prompt (as if simulating a multi-turn conversation). You can also put words into a terminal `assistant` message for Claude to continue from where you left off (more on that in later chapters).\n", "\n", "#### System Prompts\n", "\n", diff --git a/Anthropic 1P/10.2_Appendix_Tool Use.ipynb b/Anthropic 1P/10.2_Appendix_Tool Use.ipynb index fb632a0..4775741 100644 --- a/Anthropic 1P/10.2_Appendix_Tool Use.ipynb +++ b/Anthropic 1P/10.2_Appendix_Tool Use.ipynb @@ -35,7 +35,7 @@ "# Rewrittten to call Claude 3 Sonnet, which is generally better at tool use, and include stop_sequences\n", "def get_completion(messages, system_prompt=\"\", prefill=\"\",stop_sequences=None):\n", " message = client.messages.create(\n", - " model=\"claude-3-sonnet-20240229\",\n", + " model=\"claude-3-5-sonnet-20241022\",\n", " max_tokens=2000,\n", " temperature=0.0,\n", " system=system_prompt,\n", @@ -55,10 +55,10 @@ "\n", "While it might seem conceptually complex at first, tool use, a.k.a. function calling, is actually quite simple! You already know all the skills necessary to implement tool use, which is really just a combination of substitution and prompt chaining.\n", "\n", - "In previous substitution exercises, we substituted text into prompts. With tool use, we substitute tool or function results into prompts. Claude can't literally call or access tools and functions. Instead, we have Claude:\n", - "1. Output the tool name and arguments it wants to call\n", - "2. Halt any further response generation while the tool is called\n", - "3. Then we reprompt with the appended tool results" + "In previous substitution exercises, we substituted text into prompts. With tool use, we substitute tool or function results into prompts. Claude now outputs structured tool calls automatically:\n", + "1. Claude outputs the tool name and arguments it wants to call\n", + "2. API handles parsing and execution\n", + "3. Built-in error handling and more reliable, consistent performance" ] }, {