From b1019b9581f16049349f588e80f1fc5d33e1263a Mon Sep 17 00:00:00 2001 From: Winston Chang Date: Thu, 24 Oct 2024 11:41:27 -0500 Subject: [PATCH 1/4] Update examples to claude-3-5-sonnet-20241022 --- shiny/templates/chat/hello-providers/anthropic/app.py | 2 +- shiny/templates/chat/production/anthropic/app.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shiny/templates/chat/hello-providers/anthropic/app.py b/shiny/templates/chat/hello-providers/anthropic/app.py index 01df47db9..0c48fe5d4 100644 --- a/shiny/templates/chat/hello-providers/anthropic/app.py +++ b/shiny/templates/chat/hello-providers/anthropic/app.py @@ -35,7 +35,7 @@ async def _(): messages = chat.messages(format="anthropic") # Create a response message stream response = await llm.messages.create( - model="claude-3-5-sonnet-20240620", + model="claude-3-5-sonnet-20241022", messages=messages, stream=True, max_tokens=1000, diff --git a/shiny/templates/chat/production/anthropic/app.py b/shiny/templates/chat/production/anthropic/app.py index b326334a2..423d4337c 100644 --- a/shiny/templates/chat/production/anthropic/app.py +++ b/shiny/templates/chat/production/anthropic/app.py @@ -24,7 +24,7 @@ MODEL_INFO = { - "name": "claude-3-5-sonnet-20240620", + "name": "claude-3-5-sonnet-20241022", # DISCLAIMER: Anthropic has not yet released a public tokenizer for Claude models, # so this uses the generic default provided by Chat() (for now). That is probably # ok though since the default tokenizer likely overestimates the token count. From 7426544360e003a37bfc9f0bd5f0c9153c78050d Mon Sep 17 00:00:00 2001 From: Winston Chang Date: Thu, 24 Oct 2024 17:37:55 -0500 Subject: [PATCH 2/4] Use -latest suffix --- examples/chat/playground/app.py | 4 ++-- shiny/templates/chat/hello-providers/anthropic/app.py | 2 +- shiny/templates/chat/production/anthropic/app.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/chat/playground/app.py b/examples/chat/playground/app.py index dbda0b62d..af205824b 100644 --- a/examples/chat/playground/app.py +++ b/examples/chat/playground/app.py @@ -15,8 +15,8 @@ models = { "openai": ["gpt-4o", "gpt-3.5-turbo"], "claude": [ - "claude-3-opus-20240229", - "claude-3-5-sonnet-20240620", + "claude-3-opus-latest", + "claude-3-5-sonnet-latest", "claude-3-haiku-20240307", ], "google": ["gemini-1.5-pro-latest"], diff --git a/shiny/templates/chat/hello-providers/anthropic/app.py b/shiny/templates/chat/hello-providers/anthropic/app.py index 0c48fe5d4..e3bae5966 100644 --- a/shiny/templates/chat/hello-providers/anthropic/app.py +++ b/shiny/templates/chat/hello-providers/anthropic/app.py @@ -35,7 +35,7 @@ async def _(): messages = chat.messages(format="anthropic") # Create a response message stream response = await llm.messages.create( - model="claude-3-5-sonnet-20241022", + model="claude-3-5-sonnet-latest", messages=messages, stream=True, max_tokens=1000, diff --git a/shiny/templates/chat/production/anthropic/app.py b/shiny/templates/chat/production/anthropic/app.py index 423d4337c..946212f56 100644 --- a/shiny/templates/chat/production/anthropic/app.py +++ b/shiny/templates/chat/production/anthropic/app.py @@ -24,7 +24,7 @@ MODEL_INFO = { - "name": "claude-3-5-sonnet-20241022", + "name": "claude-3-5-sonnet-latest", # DISCLAIMER: Anthropic has not yet released a public tokenizer for Claude models, # so this uses the generic default provided by Chat() (for now). That is probably # ok though since the default tokenizer likely overestimates the token count. From 9021a61e0404989c478dbe4ea02b5824a6650b86 Mon Sep 17 00:00:00 2001 From: Winston Chang Date: Thu, 24 Oct 2024 17:38:04 -0500 Subject: [PATCH 3/4] Update Claude model for AWS --- shiny/templates/chat/enterprise/aws-bedrock-anthropic/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shiny/templates/chat/enterprise/aws-bedrock-anthropic/app.py b/shiny/templates/chat/enterprise/aws-bedrock-anthropic/app.py index 397af3583..fa9b7859e 100644 --- a/shiny/templates/chat/enterprise/aws-bedrock-anthropic/app.py +++ b/shiny/templates/chat/enterprise/aws-bedrock-anthropic/app.py @@ -39,7 +39,7 @@ async def _(): messages = chat.messages(format="anthropic") # Create a response message stream response = llm.messages.create( - model="anthropic.claude-3-sonnet-20240229-v1:0", + model="anthropic.claude-3-5-sonnet-20241022-v2:0", messages=messages, stream=True, max_tokens=1000, From b9b317a0a8a2d4dd87f96a3df4ba98bf3b4eee5e Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Tue, 29 Oct 2024 15:41:45 -0500 Subject: [PATCH 4/4] Update shiny/templates/chat/production/anthropic/app.py --- shiny/templates/chat/production/anthropic/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shiny/templates/chat/production/anthropic/app.py b/shiny/templates/chat/production/anthropic/app.py index 946212f56..423d4337c 100644 --- a/shiny/templates/chat/production/anthropic/app.py +++ b/shiny/templates/chat/production/anthropic/app.py @@ -24,7 +24,7 @@ MODEL_INFO = { - "name": "claude-3-5-sonnet-latest", + "name": "claude-3-5-sonnet-20241022", # DISCLAIMER: Anthropic has not yet released a public tokenizer for Claude models, # so this uses the generic default provided by Chat() (for now). That is probably # ok though since the default tokenizer likely overestimates the token count.