diff --git a/README.md b/README.md index cd376246..10ed0842 100644 --- a/README.md +++ b/README.md @@ -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) ``` @@ -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) @@ -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: @@ -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: @@ -145,7 +145,7 @@ async def main() -> None: "content": "Say hello there!", } ], - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", ) as stream: async for text in stream.text_stream: print(text, end="", flush=True) @@ -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") @@ -440,7 +440,7 @@ message = client.messages.create( "content": "Hello, Claude", } ], - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", ) print(message._request_id) # req_018EeWyXxfu5pfWkrYcMdjWG ``` @@ -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", ) ``` @@ -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", ) ``` @@ -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')) @@ -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")) diff --git a/examples/images.py b/examples/images.py index 0da834bc..0ebf2eb5 100644 --- a/examples/images.py +++ b/examples/images.py @@ -25,6 +25,6 @@ ], }, ], - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", ) print(response.model_dump_json(indent=2)) diff --git a/examples/messages.py b/examples/messages.py index f2e7e3c2..55151dd0 100644 --- a/examples/messages.py +++ b/examples/messages.py @@ -10,7 +10,7 @@ "content": "Hello!", } ], - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", ) print(response) @@ -30,6 +30,6 @@ "content": "How are you?", }, ], - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", ) print(response2) diff --git a/examples/messages_stream.py b/examples/messages_stream.py index be69a2c1..a7288aab 100644 --- a/examples/messages_stream.py +++ b/examples/messages_stream.py @@ -14,7 +14,7 @@ async def main() -> None: "content": "Say hello there!", } ], - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", ) as stream: async for event in stream: if event.type == "text": diff --git a/examples/tools.py b/examples/tools.py index c0a8ea60..b6978757 100644 --- a/examples/tools.py +++ b/examples/tools.py @@ -21,7 +21,7 @@ ] message = client.messages.create( - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", max_tokens=1024, messages=[user_message], tools=tools, @@ -32,7 +32,7 @@ tool = next(c for c in message.content if c.type == "tool_use") response = client.messages.create( - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", max_tokens=1024, messages=[ user_message, diff --git a/helpers.md b/helpers.md index 55c249a2..65eac0bf 100644 --- a/helpers.md +++ b/helpers.md @@ -11,7 +11,7 @@ async with client.messages.stream( "content": "Say hello there!", } ], - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", ) as stream: async for text in stream.text_stream: print(text, end="", flush=True) @@ -60,7 +60,7 @@ async with client.messages.stream( "content": "Say hello there!", } ], - model="claude-3-opus-20240229", + model="claude-3-5-sonnet-latest", ) as stream: async for event in stream: if event.type == "text": diff --git a/tests/test_client.py b/tests/test_client.py index f50233f0..ca181ada 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -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, @@ -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, @@ -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, @@ -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,