Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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",
Expand Down Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions examples/anthropic/agentops-anthropic-understanding-tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/anthropic/anthropic-example-async.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/anthropic/anthropic-example-async.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/anthropic/anthropic-example-sync.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/anthropic/anthropic-example-sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down