10000 update example to use Claude sonnet 3.5 (#11873) · dtest/python-docs-samples@56b73c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 56b73c0

Browse files
update example to use Claude sonnet 3.5 (GoogleCloudPlatform#11873)
Co-authored-by: Huy Ngo <huyngo@google.com>
1 parent cff3082 commit 56b73c0

5 files changed

+5
-5
lines changed

generative_ai/anthropic_claude_3_streaming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def generate_text_streaming(project_id: str, region: str) -> str:
2626
result = []
2727

2828
with client.messages.stream(
29-
model="claude-3-sonnet@20240229",
29+
model="claude-3-5-sonnet@20240620",
3030
max_tokens=1024,
3131
messages=[
3232
{

generative_ai/anthropic_claude_3_streaming_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
_PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT")
24-
_LOCATION = "us-central1"
24+
_LOCATION = "us-east5"
2525

2626

2727
@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)

generative_ai/anthropic_claude_3_tool_use.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
def tool_use(project_id: str, region: str) -> object:
2525
client = AnthropicVertex(region=region, project_id=project_id)
2626
message = client.messages.create(
27-
model="claude-3-opus@20240229",
27+
model="claude-3-5-sonnet@20240620",
2828
max_tokens=1024,
2929
tools=[
3030
{

generative_ai/anthropic_claude_3_unary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def generate_text(project_id: str, region: str) -> object:
2424

2525
client = AnthropicVertex(region=region, project_id=project_id)
2626
message = client.messages.create(
27-
model="claude-3-sonnet@20240229",
27+
model="claude-3-5-sonnet@20240620",
2828
max_tokens=1024,
2929
messages=[
3030
{

generative_ai/anthropic_claude_3_unary_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import anthropic_claude_3_unary
2121

2222
_PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT")
23-
_LOCATION = "us-central1"
23+
_LOCATION = "us-east5"
2424

2525

2626
@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)

0 commit comments

Comments
 (0)
0