Skip to content

Commit

Permalink
docs: use latest sonnet in example snippets (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Dec 10, 2024
1 parent df1a549 commit 6f0869c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ message = client.messages.create(
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
)
print(message.content)
```
Expand Down Expand Up @@ -70,7 +70,7 @@ async def main() -> None:
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
)
print(message.content)

Expand All @@ -97,7 +97,7 @@ stream = client.messages.create(
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
stream=True,
)
for event in stream:
Expand All @@ -119,7 +119,7 @@ stream = await client.messages.create(
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
stream=True,
)
async for event in stream:
Expand Down Expand Up @@ -399,7 +399,7 @@ try:
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
)
except anthropic.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -475,7 +475,7 @@ client.with_options(max_retries=5).messages.create(
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
)
```

Expand Down Expand Up @@ -507,7 +507,7 @@ client.with_options(timeout=5.0).messages.create(
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
)
```

Expand Down Expand Up @@ -571,7 +571,7 @@ response = client.messages.with_raw_response.create(
"role": "user",
"content": "Hello, Claude",
}],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
)
print(response.headers.get('X-My-Header'))

Expand Down Expand Up @@ -605,7 +605,7 @@ with client.messages.with_streaming_response.create(
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
) as response:
print(response.headers.get("X-My-Header"))

Expand Down
8 changes: 4 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
),
),
cast_to=httpx.Response,
Expand All @@ -772,7 +772,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
),
),
cast_to=httpx.Response,
Expand Down Expand Up @@ -1625,7 +1625,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
),
),
cast_to=httpx.Response,
Expand All @@ -1652,7 +1652,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
model="claude-3-5-sonnet-latest",
),
),
cast_to=httpx.Response,
Expand Down

0 comments on commit 6f0869c

Please sign in to comment.