Skip to content

Commit

Permalink
chore(examples): update tools
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie committed May 30, 2024
1 parent 52bd67b commit 56edecc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/tools.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import annotations

from anthropic import Anthropic
from anthropic.types.beta.tools import ToolParam, ToolsBetaMessageParam
from anthropic.types import ToolParam, MessageParam

client = Anthropic()

user_message: ToolsBetaMessageParam = {
user_message: MessageParam = {
"role": "user",
"content": "What is the weather in SF?",
}
Expand All @@ -20,7 +20,7 @@
}
]

message = client.beta.tools.messages.create(
message = client.messages.create(
model="claude-3-opus-20240229",
max_tokens=1024,
messages=[user_message],
Expand All @@ -31,7 +31,7 @@
assert message.stop_reason == "tool_use"

tool = next(c for c in message.content if c.type == "tool_use")
response = client.beta.tools.messages.create(
response = client.messages.create(
model="claude-3-opus-20240229",
max_tokens=1024,
messages=[
Expand Down

0 comments on commit 56edecc

Please sign in to comment.