diff --git a/AmazonBedrock/anthropic/00_Tutorial_How-To.ipynb b/AmazonBedrock/anthropic/00_Tutorial_How-To.ipynb index cf56243..bbee5b7 100755 --- a/AmazonBedrock/anthropic/00_Tutorial_How-To.ipynb +++ b/AmazonBedrock/anthropic/00_Tutorial_How-To.ipynb @@ -66,7 +66,7 @@ "\n", "## Usage Notes & Tips 💡\n", "\n", - "- This course uses Claude 3 Haiku with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to previous generation legacy Claude models such as Claude 2 and Claude Instant 1.2.\n", + "- This course uses Claude Haiku (latest) with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to other Claude models as well.\n", "\n", "- You can use `Shift + Enter` to execute the cell and move to the next one.\n", "\n", @@ -95,7 +95,8 @@ "session = boto3.Session() # create a boto3 session to dynamically get and set the region name\n", "AWS_REGION = session.region_name\n", "print(\"AWS Region:\", AWS_REGION)\n", - "MODEL_NAME = \"anthropic.claude-3-haiku-20240307-v1:0\"\n", + "# \"latest\" alias auto-updates when new models release; pin a specific version if needed\n", + "MODEL_NAME = \"anthropic.claude-haiku-4-5-latest-v1:0\"\n", "\n", "%store MODEL_NAME\n", "%store AWS_REGION" diff --git a/AmazonBedrock/anthropic/10_2_Appendix_Tool_Use.ipynb b/AmazonBedrock/anthropic/10_2_Appendix_Tool_Use.ipynb index d147206..6a3e6a5 100644 --- a/AmazonBedrock/anthropic/10_2_Appendix_Tool_Use.ipynb +++ b/AmazonBedrock/anthropic/10_2_Appendix_Tool_Use.ipynb @@ -35,12 +35,12 @@ "from anthropic import AnthropicBedrock\n", "\n", "# Override the MODEL_NAME variable in the IPython store to use Sonnet instead of the Haiku model\n", - "MODEL_NAME='anthropic.claude-3-sonnet-20240229-v1:0'\n", + "MODEL_NAME='anthropic.claude-sonnet-4-5-latest-v1:0'\n", "%store -r AWS_REGION\n", "\n", "client = AnthropicBedrock(aws_region=AWS_REGION)\n", "\n", - "# Rewrittten to call Claude 3 Sonnet, which is generally better at tool use, and include stop_sequences\n", + "# Rewritten to call Claude 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=MODEL_NAME,\n", diff --git a/AmazonBedrock/anthropic/10_3_Appendix_Empirical_Performance_Evaluations.ipynb b/AmazonBedrock/anthropic/10_3_Appendix_Empirical_Performance_Evaluations.ipynb index 1bc342a..fd541fe 100755 --- a/AmazonBedrock/anthropic/10_3_Appendix_Empirical_Performance_Evaluations.ipynb +++ b/AmazonBedrock/anthropic/10_3_Appendix_Empirical_Performance_Evaluations.ipynb @@ -33,7 +33,7 @@ "outputs": [], "source": [ "# Store the model name and AWS region for later use\n", - "MODEL_NAME = \"anthropic.claude-3-haiku-20240307-v1:0\"\n", + "MODEL_NAME = \"anthropic.claude-haiku-4-5-latest-v1:0\"\n", "AWS_REGION = \"us-west-2\"\n", "\n", "%store MODEL_NAME\n", diff --git a/AmazonBedrock/boto3/00_Tutorial_How-To.ipynb b/AmazonBedrock/boto3/00_Tutorial_How-To.ipynb index a78ae59..6708050 100755 --- a/AmazonBedrock/boto3/00_Tutorial_How-To.ipynb +++ b/AmazonBedrock/boto3/00_Tutorial_How-To.ipynb @@ -71,7 +71,7 @@ "\n", "## Usage Notes & Tips 💡\n", "\n", - "- This course uses Claude 3 Haiku with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to previous generation legacy Claude models such as Claude 2 and Claude Instant 1.2.\n", + "- This course uses Claude Haiku (latest) with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to other Claude models as well.\n", "\n", "- You can use `Shift + Enter` to execute the cell and move to the next one.\n", "\n", @@ -100,7 +100,8 @@ "session = boto3.Session() # create a boto3 session to dynamically get and set the region name\n", "AWS_REGION = session.region_name\n", "print(\"AWS Region:\", AWS_REGION)\n", - "MODEL_NAME = \"anthropic.claude-3-haiku-20240307-v1:0\"\n", + "# \"latest\" alias auto-updates when new models release; pin a specific version if needed\n", + "MODEL_NAME = \"anthropic.claude-haiku-4-5-latest-v1:0\"\n", "\n", "%store MODEL_NAME\n", "%store AWS_REGION" diff --git a/AmazonBedrock/boto3/10_2_Appendix_Tool_Use.ipynb b/AmazonBedrock/boto3/10_2_Appendix_Tool_Use.ipynb index baa4800..2081f4c 100644 --- a/AmazonBedrock/boto3/10_2_Appendix_Tool_Use.ipynb +++ b/AmazonBedrock/boto3/10_2_Appendix_Tool_Use.ipynb @@ -21,7 +21,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Rewrittten to call Claude 3 Sonnet, which is generally better at tool use, and include stop_sequences\n", + "# Rewritten to call Claude Sonnet, which is generally better at tool use, and include stop_sequences\n", "# Import python's built-in regular expression library\n", "import re\n", "import boto3\n", @@ -35,7 +35,7 @@ "from utils import hints\n", "\n", "# Override the MODEL_NAME variable in the IPython store to use Sonnet instead of the Haiku model\n", - "MODEL_NAME='anthropic.claude-3-sonnet-20240229-v1:0'\n", + "MODEL_NAME='anthropic.claude-sonnet-4-5-latest-v1:0'\n", "%store -r AWS_REGION\n", "\n", "client = boto3.client('bedrock-runtime',region_name=AWS_REGION)\n", diff --git a/AmazonBedrock/boto3/10_3_Appendix_Empirical_Performance_Eval.ipynb b/AmazonBedrock/boto3/10_3_Appendix_Empirical_Performance_Eval.ipynb index b248d8e..5febf88 100755 --- a/AmazonBedrock/boto3/10_3_Appendix_Empirical_Performance_Eval.ipynb +++ b/AmazonBedrock/boto3/10_3_Appendix_Empirical_Performance_Eval.ipynb @@ -40,7 +40,7 @@ "import json\n", "\n", "# Store the model name and AWS region for later use\n", - "MODEL_NAME = \"anthropic.claude-3-haiku-20240307-v1:0\"\n", + "MODEL_NAME = \"anthropic.claude-haiku-4-5-latest-v1:0\"\n", "AWS_REGION = \"us-west-2\"\n", "\n", "%store MODEL_NAME\n", diff --git a/AmazonBedrock/requirements.txt b/AmazonBedrock/requirements.txt index 0c4b3a5..2bebb60 100644 --- a/AmazonBedrock/requirements.txt +++ b/AmazonBedrock/requirements.txt @@ -1,5 +1,5 @@ -awscli==1.32.74 -boto3==1.34.74 -botocore==1.34.74 -anthropic==0.21.3 +awscli +boto3 +botocore +anthropic>=0.39.0 pickleshare==0.7.5 diff --git a/Anthropic 1P/00_Tutorial_How-To.ipynb b/Anthropic 1P/00_Tutorial_How-To.ipynb index befac63..be7154b 100644 --- a/Anthropic 1P/00_Tutorial_How-To.ipynb +++ b/Anthropic 1P/00_Tutorial_How-To.ipynb @@ -44,7 +44,8 @@ "outputs": [], "source": [ "API_KEY = \"your_api_key_here\"\n", - "MODEL_NAME = \"claude-3-haiku-20240307\"\n", + "# \"latest\" alias auto-updates when new models release; pin a specific version if needed\n", + "MODEL_NAME = \"claude-haiku-4-5-latest\"\n", "\n", "# Stores the API_KEY & MODEL_NAME variables for use across notebooks within the IPython store\n", "%store API_KEY\n", @@ -66,7 +67,7 @@ "\n", "## Usage Notes & Tips 💡\n", "\n", - "- This course uses Claude 3 Haiku with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to previous generation legacy Claude models such as Claude 2 and Claude Instant 1.2.\n", + "- This course uses Claude Haiku (latest) with temperature 0. We will talk more about temperature later in the course. For now, it's enough to understand that these settings yield more deterministic results. All prompt engineering techniques in this course also apply to other Claude models as well.\n", "\n", "- You can use `Shift + Enter` to execute the cell and move to the next one.\n", "\n", diff --git a/Anthropic 1P/10.2_Appendix_Tool Use.ipynb b/Anthropic 1P/10.2_Appendix_Tool Use.ipynb index fb632a0..575acd8 100644 --- a/Anthropic 1P/10.2_Appendix_Tool Use.ipynb +++ b/Anthropic 1P/10.2_Appendix_Tool Use.ipynb @@ -32,10 +32,10 @@ "\n", "client = anthropic.Anthropic(api_key=API_KEY)\n", "\n", - "# Rewrittten to call Claude 3 Sonnet, which is generally better at tool use, and include stop_sequences\n", + "# Rewritten to call Claude 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-sonnet-4-5-latest\",\n", " max_tokens=2000,\n", " temperature=0.0,\n", " system=system_prompt,\n",