diff --git a/README.md b/README.md index ba4a8fc50..50bd4a97f 100644 --- a/README.md +++ b/README.md @@ -447,7 +447,7 @@ message = client.messages.create( "content": "Tell me a cool fact about AgentOps", } ], - model="claude-3-opus-20240229", + model="claude-opus-5", ) print(message.content) @@ -469,7 +469,7 @@ client = anthropic.Anthropic( stream = client.messages.create( max_tokens=1024, - model="claude-3-opus-20240229", + model="claude-opus-5", messages=[ { "role": "user", @@ -510,7 +510,7 @@ async def main() -> None: "content": "Tell me something interesting about async agents", } ], - model="claude-3-opus-20240229", + model="claude-opus-5", ) print(message.content) diff --git a/examples/anthropic/agentops-anthropic-understanding-tools.ipynb b/examples/anthropic/agentops-anthropic-understanding-tools.ipynb index d9ab8a021..841bce3ac 100644 --- a/examples/anthropic/agentops-anthropic-understanding-tools.ipynb +++ b/examples/anthropic/agentops-anthropic-understanding-tools.ipynb @@ -234,7 +234,7 @@ "cell_type": "code", "metadata": {}, "outputs": [], - "source": "response = client.messages.create(\n max_tokens=5000,\n model=\"claude-3-7-sonnet-20250219\",\n tools=[\n {\n \"name\": \"generate_missions\",\n \"description\": \"Retrieve three missions for the DoomSlayer\",\n \"input_schema\": {\"type\": \"object\", \"properties\": {}, \"required\": []},\n }\n ],\n messages=initial_messages,\n)\n\nprint(response.content)" + "source": "response = client.messages.create(\n max_tokens=5000,\n model=\"claude-sonnet-5\",\n tools=[\n {\n \"name\": \"generate_missions\",\n \"description\": \"Retrieve three missions for the DoomSlayer\",\n \"input_schema\": {\"type\": \"object\", \"properties\": {}, \"required\": []},\n }\n ],\n messages=initial_messages,\n)\n\nprint(response.content)" }, { "cell_type": "markdown", @@ -320,7 +320,7 @@ "cell_type": "code", "metadata": {}, "outputs": [], - "source": "response = client.messages.create(\n max_tokens=5000,\n model=\"claude-3-7-sonnet-20250219\",\n tools=[\n {\n \"name\": \"generate_missions\",\n \"description\": \"Retrieve three missions for the DoomSlayer\",\n \"input_schema\": {\"type\": \"object\", \"properties\": {}, \"required\": []},\n }\n ],\n messages=initial_messages,\n)\n\nprint(response)" + "source": "response = client.messages.create(\n max_tokens=5000,\n model=\"claude-sonnet-5\",\n tools=[\n {\n \"name\": \"generate_missions\",\n \"description\": \"Retrieve three missions for the DoomSlayer\",\n \"input_schema\": {\"type\": \"object\", \"properties\": {}, \"required\": []},\n }\n ],\n messages=initial_messages,\n)\n\nprint(response)" }, { "cell_type": "markdown", @@ -510,7 +510,7 @@ "cell_type": "code", "metadata": {}, "outputs": [], - "source": "response = client.messages.create(\n max_tokens=5000,\n model=\"claude-3-7-sonnet-20250219\",\n tools=[\n {\n \"name\": \"enemyscan_tool\",\n \"description\": \"Retrieve a list of demons currently present in the area.\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"amount\": {\n \"type\": \"integer\",\n \"description\": \"Number of enemies to scan.\",\n }\n },\n \"required\": [\"amount\"],\n },\n },\n {\n \"name\": \"inventoryscan_tool\",\n \"description\": \"Retrieve a list of weapons the Doom Slayer has at hand.\",\n \"input_schema\": {\"type\": \"object\", \"properties\": {}, \"required\": []},\n },\n ],\n messages=initial_messages,\n)\n\nprint(response)" + "source": "response = client.messages.create(\n max_tokens=5000,\n model=\"claude-sonnet-5\",\n tools=[\n {\n \"name\": \"enemyscan_tool\",\n \"description\": \"Retrieve a list of demons currently present in the area.\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"amount\": {\n \"type\": \"integer\",\n \"description\": \"Number of enemies to scan.\",\n }\n },\n \"required\": [\"amount\"],\n },\n },\n {\n \"name\": \"inventoryscan_tool\",\n \"description\": \"Retrieve a list of weapons the Doom Slayer has at hand.\",\n \"input_schema\": {\"type\": \"object\", \"properties\": {}, \"required\": []},\n },\n ],\n messages=initial_messages,\n)\n\nprint(response)" }, { "cell_type": "markdown", @@ -619,7 +619,7 @@ "cell_type": "code", "metadata": {}, "outputs": [], - "source": "response = client.messages.create(\n max_tokens=5000,\n model=\"claude-3-7-sonnet-20250219\",\n tools=[\n {\n \"name\": \"enemyscan_tool\",\n \"description\": \"Retrieve a list of demons currently present in the area.\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"amount\": {\n \"type\": \"integer\",\n \"description\": \"Number of enemies to scan.\",\n }\n },\n \"required\": [\"amount\"],\n },\n },\n {\n \"name\": \"inventoryscan_tool\",\n \"description\": \"Retrieve a list of weapons the Doom Slayer has at hand.\",\n \"input_schema\": {\"type\": \"object\", \"properties\": {}, \"required\": []},\n },\n ],\n messages=initial_messages,\n)\n\nmessage = response.content[0].text\nprint(message)" + "source": "response = client.messages.create(\n max_tokens=5000,\n model=\"claude-sonnet-5\",\n tools=[\n {\n \"name\": \"enemyscan_tool\",\n \"description\": \"Retrieve a list of demons currently present in the area.\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"amount\": {\n \"type\": \"integer\",\n \"description\": \"Number of enemies to scan.\",\n }\n },\n \"required\": [\"amount\"],\n },\n },\n {\n \"name\": \"inventoryscan_tool\",\n \"description\": \"Retrieve a list of weapons the Doom Slayer has at hand.\",\n \"input_schema\": {\"type\": \"object\", \"properties\": {}, \"required\": []},\n },\n ],\n messages=initial_messages,\n)\n\nmessage = response.content[0].text\nprint(message)" } ], "metadata": { diff --git a/examples/anthropic/agentops-anthropic-understanding-tools.py b/examples/anthropic/agentops-anthropic-understanding-tools.py index ed6898250..d3c8a305e 100644 --- a/examples/anthropic/agentops-anthropic-understanding-tools.py +++ b/examples/anthropic/agentops-anthropic-understanding-tools.py @@ -103,7 +103,7 @@ def generate_missions(): # Now to construct a request! response = client.messages.create( max_tokens=5000, - model="claude-3-7-sonnet-20250219", + model="claude-sonnet-5", tools=[ { "name": "generate_missions", @@ -149,7 +149,7 @@ def generate_missions(): # And now to get a response! response = client.messages.create( max_tokens=5000, - model="claude-3-7-sonnet-20250219", + model="claude-sonnet-5", tools=[ { "name": "generate_missions", @@ -263,7 +263,7 @@ def inventoryscan(): # With that, let's construct our new tools and run this!! response = client.messages.create( max_tokens=5000, - model="claude-3-7-sonnet-20250219", + model="claude-sonnet-5", tools=[ { "name": "enemyscan_tool", @@ -344,7 +344,7 @@ def inventoryscan(): ) response = client.messages.create( max_tokens=5000, - model="claude-3-7-sonnet-20250219", + model="claude-sonnet-5", tools=[ { "name": "enemyscan_tool", diff --git a/examples/anthropic/anthropic-example-async.ipynb b/examples/anthropic/anthropic-example-async.ipynb index 43a45a98e..5770c8c37 100644 --- a/examples/anthropic/anthropic-example-async.ipynb +++ b/examples/anthropic/anthropic-example-async.ipynb @@ -214,7 +214,7 @@ "trusted": true }, "outputs": [], - "source": "Personality = {random.choice(TitanPersonality)}\nHealth = {random.choice(TitanHealth)}\n\n\nasync def req():\n # Start a streaming message request\n stream = client.messages.create(\n max_tokens=1024,\n model=\"claude-3-7-sonnet-20250219\",\n messages=[\n {\n \"role\": \"user\",\n \"content\": \"You are a Titan; a mech from Titanfall 2. Based on your titan's personality and status, generate a message for your pilot. If Near Destruction, make an all caps death message such as AVENGE ME or UNTIL NEXT TIME.\",\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Personality: Legion is a relentless and heavy-hitting Titan that embodies brute strength and defensive firepower. He speaks bluntly. Status: Considerable Damage\",\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Heavy damage detected. Reinforcements would be appreciated, but I can still fight.\",\n },\n {\n \"role\": \"user\",\n \"content\": \"You are a Titan; a mech from Titanfall 2. Based on your titan's personality and status, generate a message for your pilot. If Near Destruction, make an all caps death message such as AVENGE ME or UNTIL NEXT TIME.\",\n },\n {\n \"role\": \"assistant\",\n \"content\": f\"Personality: {Personality}. Status: {Health}\",\n },\n ],\n stream=True,\n )\n\n response = \"\"\n for event in stream:\n if event.type == \"content_block_delta\":\n response += event.delta.text\n elif event.type == \"message_stop\":\n break # Exit the loop when the message completes\n\n return response\n\n\nasync def generate_uuids():\n uuids = [str(uuid.uuid4()) for _ in range(4)]\n return uuids" + "source": "Personality = {random.choice(TitanPersonality)}\nHealth = {random.choice(TitanHealth)}\n\n\nasync def req():\n # Start a streaming message request\n stream = client.messages.create(\n max_tokens=1024,\n model=\"claude-sonnet-5\",\n messages=[\n {\n \"role\": \"user\",\n \"content\": \"You are a Titan; a mech from Titanfall 2. Based on your titan's personality and status, generate a message for your pilot. If Near Destruction, make an all caps death message such as AVENGE ME or UNTIL NEXT TIME.\",\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Personality: Legion is a relentless and heavy-hitting Titan that embodies brute strength and defensive firepower. He speaks bluntly. Status: Considerable Damage\",\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Heavy damage detected. Reinforcements would be appreciated, but I can still fight.\",\n },\n {\n \"role\": \"user\",\n \"content\": \"You are a Titan; a mech from Titanfall 2. Based on your titan's personality and status, generate a message for your pilot. If Near Destruction, make an all caps death message such as AVENGE ME or UNTIL NEXT TIME.\",\n },\n {\n \"role\": \"assistant\",\n \"content\": f\"Personality: {Personality}. Status: {Health}\",\n },\n ],\n stream=True,\n )\n\n response = \"\"\n for event in stream:\n if event.type == \"content_block_delta\":\n response += event.delta.text\n elif event.type == \"message_stop\":\n break # Exit the loop when the message completes\n\n return response\n\n\nasync def generate_uuids():\n uuids = [str(uuid.uuid4()) for _ in range(4)]\n return uuids" }, { "cell_type": "markdown", diff --git a/examples/anthropic/anthropic-example-async.py b/examples/anthropic/anthropic-example-async.py index 26f6b2b65..3a5dc52a1 100644 --- a/examples/anthropic/anthropic-example-async.py +++ b/examples/anthropic/anthropic-example-async.py @@ -48,7 +48,7 @@ async def req(): # Start a streaming message request stream = client.messages.create( max_tokens=1024, - model="claude-3-7-sonnet-20250219", + model="claude-sonnet-5", messages=[ { "role": "user", diff --git a/examples/anthropic/anthropic-example-sync.ipynb b/examples/anthropic/anthropic-example-sync.ipynb index 9944f95b6..50b9733fc 100644 --- a/examples/anthropic/anthropic-example-sync.ipynb +++ b/examples/anthropic/anthropic-example-sync.ipynb @@ -261,7 +261,7 @@ "source": [ "stream = client.messages.create(\n", " max_tokens=2400,\n", - " model=\"claude-3-7-sonnet-20250219\", # Comma added here\n", + " model=\"claude-sonnet-5\", # Comma added here\n", " messages=[\n", " {\n", " \"role\": \"user\",\n", diff --git a/examples/anthropic/anthropic-example-sync.py b/examples/anthropic/anthropic-example-sync.py index 08db9058d..4218f7709 100644 --- a/examples/anthropic/anthropic-example-sync.py +++ b/examples/anthropic/anthropic-example-sync.py @@ -79,7 +79,7 @@ # And now to construct a stream/message! We set an example for the assistant now! stream = client.messages.create( max_tokens=2400, - model="claude-3-7-sonnet-20250219", # Comma added here + model="claude-sonnet-5", # Comma added here messages=[ { "role": "user",