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
13 changes: 10 additions & 3 deletions anthropic_api_fundamentals/03_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@
"Refer to [this table](https://docs.anthropic.com/en/docs/about-claude/models#model-comparison-table) for a comparison of the key features and capabilities of each model in the Claude family."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Note:** Model versions are updated periodically. The models used in this notebook may become deprecated over time. Always refer to the [model comparison table](https://docs.anthropic.com/en/docs/about-claude/models#model-comparison-table) for the most current list of available models and their version IDs."
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -79,7 +86,7 @@
"source": [
"import time\n",
"def compare_model_speeds():\n",
" models = [\"claude-3-5-sonnet-20240620\",\"claude-3-opus-20240229\", \"claude-3-sonnet-20240229\", \"claude-3-haiku-20240307\"]\n",
" models = [\"claude-3-5-sonnet-20241022\", \"claude-3-5-sonnet-20240620\", \"claude-3-haiku-20240307\"]\n",
" task = \"Explain the concept of photosynthesis in a concise paragraph.\"\n",
"\n",
" for model in models:\n",
Expand Down Expand Up @@ -215,7 +222,7 @@
"outputs": [],
"source": [
"def compare_model_capabilities():\n",
" models = [\"claude-3-5-sonnet-20240620\", \"claude-3-opus-20240229\", \"claude-3-sonnet-20240229\", \"claude-3-haiku-20240307\"]\n",
" models = [\"claude-3-5-sonnet-20241022\", \"claude-3-5-sonnet-20240620\", \"claude-3-haiku-20240307\"]\n",
" task = \"\"\"\n",
" What is the geometric monthly fecal coliform mean of a distribution system with the following FC\n",
" counts: 24, 15, 7, 16, 31 and 23? The result will be inputted into a NPDES DMR, therefore, round\n",
Expand Down Expand Up @@ -333,4 +340,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,7 @@
},
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, we can click the \"Add Row\" button to add some new test cases. Let's add in two new test cases: some Ruby code and some C# code: \n",
"\n",
"![evaluate2.png](attachment:evaluate2.png)\n"
]
"source": "<cell_type>markdown</cell_type>Next, we can click the \"Add Row\" button to add some new test cases. Let's add in two new test cases: some Ruby code and some C# code: \n\n![evaluate2.png](attachment:evaluate2.png)\n\nHere are the test cases we're adding:\n\n**Ruby Code Test Case:**\n```ruby\nclass Person\n attr_reader :name, :age\n\n def initialize(name, age)\n @name = name\n @age = age\n end\n\n def birthday!\n @age += 1\n end\n\n def introduce\n puts \"Hello, I'm #{@name} and I'm #{@age} years old.\"\n end\n\n def self.create_family(members)\n members.map { |name, age| new(name, age) }\n end\nend\n\nfamily = Person.create_family([[\"Alice\", 35], [\"Bob\", 40], [\"Charlie\", 12]])\nfamily.each(&:introduce)\n\ncharlie = family.find { |p| p.name == \"Charlie\" }\ncharlie.birthday!\ncharlie.introduce\n```\n\n**C# Code Test Case:**\n```csharp\nusing System;\n\npublic class Program\n{\n public static void Main(string[] args)\n {\n int chickenCount = 99;\n Console.WriteLine($\"There are {chickenCount} chickens.\");\n }\n}\n```\n</cell_type>"
},
{
"attachments": {
Expand Down Expand Up @@ -450,4 +446,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
Loading