From 42691177ebd290da149e1b973a6051426cfd9435 Mon Sep 17 00:00:00 2001 From: tommy Date: Mon, 9 Sep 2024 15:17:55 +0800 Subject: [PATCH 1/4] FIX: fix typo --- .../Anthropic 1P/01_Basic_Prompt_Structure.ipynb | 2 +- .../Anthropic 1P/02_Being_Clear_and_Direct.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prompt_engineering_interactive_tutorial/Anthropic 1P/01_Basic_Prompt_Structure.ipynb b/prompt_engineering_interactive_tutorial/Anthropic 1P/01_Basic_Prompt_Structure.ipynb index 625c8e6..9a5971c 100644 --- a/prompt_engineering_interactive_tutorial/Anthropic 1P/01_Basic_Prompt_Structure.ipynb +++ b/prompt_engineering_interactive_tutorial/Anthropic 1P/01_Basic_Prompt_Structure.ipynb @@ -62,7 +62,7 @@ "- `max_tokens`: the maximum number of tokens to generate before stopping. Note that Claude may stop before reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate. Furthermore, this is a *hard* stop, meaning that it may cause Claude to stop generating mid-word or mid-sentence.\n", "\n", "- `messages`: an array of input messages. Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the messages parameter, and the model then generates the next `Message` in the conversation.\n", - " - Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages (they must alternate, if so). The first message must always use the user `role`.\n", + " - Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages (they must alternate, if so). The first message must always use the `user` role.\n", "\n", "There are also optional parameters, such as:\n", "- `system`: the system prompt - more on this below.\n", diff --git a/prompt_engineering_interactive_tutorial/Anthropic 1P/02_Being_Clear_and_Direct.ipynb b/prompt_engineering_interactive_tutorial/Anthropic 1P/02_Being_Clear_and_Direct.ipynb index bcdb0ba..351fe87 100644 --- a/prompt_engineering_interactive_tutorial/Anthropic 1P/02_Being_Clear_and_Direct.ipynb +++ b/prompt_engineering_interactive_tutorial/Anthropic 1P/02_Being_Clear_and_Direct.ipynb @@ -180,7 +180,7 @@ "metadata": {}, "outputs": [], "source": [ - "# System prompt - this is the only field you should chnage\n", + "# System prompt - this is the only field you should change\n", "SYSTEM_PROMPT = \"[Replace this text]\"\n", "\n", "# Prompt\n", From 77b69879069ae353cd9b1dcd5b483010db79ea35 Mon Sep 17 00:00:00 2001 From: tommy Date: Tue, 10 Sep 2024 10:29:08 +0800 Subject: [PATCH 2/4] FIX: fix typo --- .../Anthropic 1P/03_Assigning_Roles_Role_Prompting.ipynb | 2 +- .../05_Formatting_Output_and_Speaking_for_Claude.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prompt_engineering_interactive_tutorial/Anthropic 1P/03_Assigning_Roles_Role_Prompting.ipynb b/prompt_engineering_interactive_tutorial/Anthropic 1P/03_Assigning_Roles_Role_Prompting.ipynb index 3b67ae3..03ff423 100644 --- a/prompt_engineering_interactive_tutorial/Anthropic 1P/03_Assigning_Roles_Role_Prompting.ipynb +++ b/prompt_engineering_interactive_tutorial/Anthropic 1P/03_Assigning_Roles_Role_Prompting.ipynb @@ -71,7 +71,7 @@ "\n", "However, when we prime Claude to inhabit the role of a cat, Claude's perspective changes, and thus **Claude's response tone, style, content adapts to the new role**. \n", "\n", - "**Note:** A bonus technique you can use is to **provide Claude context on its intended audience**. Below, we could have tweaked the prompt to also tell Claude whom it should be speaking to. \"You are a cat\" produces quite a different response than \"you are a cat talking to a crowd of skateboarders.\n", + "**Note:** A bonus technique you can use is to **provide Claude context on its intended audience**. Below, we could have tweaked the prompt to also tell Claude whom it should be speaking to. \"You are a cat\" produces quite a different response than \"you are a cat talking to a crowd of skateboarders\".\n", "\n", "Here is the prompt without role prompting in the system prompt:" ] diff --git a/prompt_engineering_interactive_tutorial/Anthropic 1P/05_Formatting_Output_and_Speaking_for_Claude.ipynb b/prompt_engineering_interactive_tutorial/Anthropic 1P/05_Formatting_Output_and_Speaking_for_Claude.ipynb index 691aa13..7ff74e4 100644 --- a/prompt_engineering_interactive_tutorial/Anthropic 1P/05_Formatting_Output_and_Speaking_for_Claude.ipynb +++ b/prompt_engineering_interactive_tutorial/Anthropic 1P/05_Formatting_Output_and_Speaking_for_Claude.ipynb @@ -95,7 +95,7 @@ "source": [ "Why is this something we'd want to do? Well, having the output in **XML tags allows the end user to reliably get the poem and only the poem by writing a short program to extract the content between XML tags**.\n", "\n", - "An extension of this technique is to **put the first XML tag in the `assistant` turn. When you put text in the `assistant` turn, you're basically telling Claude that Claude has already said something, and that it should continue from that point onward. This technique is called \"speaking for Claude\" or \"prefilling Claude's response.\"\n", + "An extension of this technique is to **put the first XML tag in the `assistant` turn**. When you put text in the `assistant` turn, you're basically telling Claude that Claude has already said something, and that it should continue from that point onward. This technique is called \"speaking for Claude\" or \"prefilling Claude's response.\"\n", "\n", "Below, we've done this with the first `` XML tag. Notice how Claude continues directly from where we left off." ] From 37826bf9d854a2b05c25f48867cb8a648c859ee6 Mon Sep 17 00:00:00 2001 From: tommy Date: Tue, 10 Sep 2024 14:17:21 +0800 Subject: [PATCH 3/4] FIX: miss f-string --- .../Anthropic 1P/09_Complex_Prompts_from_Scratch.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prompt_engineering_interactive_tutorial/Anthropic 1P/09_Complex_Prompts_from_Scratch.ipynb b/prompt_engineering_interactive_tutorial/Anthropic 1P/09_Complex_Prompts_from_Scratch.ipynb index 2b20ae2..8f782c4 100644 --- a/prompt_engineering_interactive_tutorial/Anthropic 1P/09_Complex_Prompts_from_Scratch.ipynb +++ b/prompt_engineering_interactive_tutorial/Anthropic 1P/09_Complex_Prompts_from_Scratch.ipynb @@ -320,7 +320,7 @@ "# Expand on the specific tasks you want Claude to do, as well as any rules that Claude might have to follow.\n", "# This is also where you can give Claude an \"out\" if it doesn't have an answer or doesn't know.\n", "# It's ideal to show this description and rules to a friend to make sure it is laid out logically and that any ambiguous words are clearly defined.\n", - "TASK_DESCRIPTION = \"\"\"Write a clear, concise answer to this question:\n", + "TASK_DESCRIPTION = f\"\"\"Write a clear, concise answer to this question:\n", "\n", "\n", "{QUESTION}\n", From c77af04312c652f4221d1b96fa8fdf52aefbc8e9 Mon Sep 17 00:00:00 2001 From: tommy Date: Tue, 10 Sep 2024 17:42:31 +0800 Subject: [PATCH 4/4] FIX: fix typo --- .../Anthropic 1P/10.2_Appendix_Tool Use.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prompt_engineering_interactive_tutorial/Anthropic 1P/10.2_Appendix_Tool Use.ipynb b/prompt_engineering_interactive_tutorial/Anthropic 1P/10.2_Appendix_Tool Use.ipynb index fb632a0..2a7b3d4 100644 --- a/prompt_engineering_interactive_tutorial/Anthropic 1P/10.2_Appendix_Tool Use.ipynb +++ b/prompt_engineering_interactive_tutorial/Anthropic 1P/10.2_Appendix_Tool Use.ipynb @@ -91,7 +91,7 @@ "\n", "*This lesson teaches our current tool use format. However, we will be updating and improving tool use functionality in the near future, including:*\n", "* *A more streamlined format for function definitions and calls*\n", - "* *More robust error handilgj and edge case coverage*\n", + "* *More robust error handling and edge case coverage*\n", "* *Tighter integration with the rest of our API*\n", "* *Better reliability and performance, especially for more complex tool use tasks*" ]