diff --git a/examples/logging/anthropic_tools_stream.py b/examples/logging/anthropic_tools_stream.py index e60e6c32..08a1cd7f 100644 --- a/examples/logging/anthropic_tools_stream.py +++ b/examples/logging/anthropic_tools_stream.py @@ -9,13 +9,26 @@ client = anthropic.Anthropic() with client.beta.tools.messages.stream( - model="claude-instant-1.2", - messages=[ + model="claude-3-haiku-20240307", + tools=[ { - "role": "user", - "content": "Howdy", + "name": "get_weather", + "description": "Get the weather at a specific location", + "input_schema": { + "type": "object", + "properties": { + "location": {"type": "string", "description": "The city and state, e.g. San Francisco, CA"}, + "unit": { + "type": "string", + "enum": ["celsius", "fahrenheit"], + "description": "Unit for the output", + }, + }, + "required": ["location"], + }, } ], + messages=[{"role": "user", "content": "What is the weather in SF?"}], max_tokens=1024, ) as stream: for message in stream: