Zack Saadioui
8/26/2024
1
anthropic
1
2
bash
pip install anthropic
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
import anthropic # Create an instance of the Anthropic API client client = anthropic.Anthropic(api_key='your_api_key_here') # Define your messages as a list of dictionaries messages = [ {"role": "user", "content": "Hello, Claude!"}, ] # Create a message sending it to Claude 3.5 Sonnet model response = client.messages.create( model="claude-3-5-sonnet-20240620", messages=messages, max_tokens=150, ) # Print the response print(response)
1
anthropic
1
Anthropic
1
claude-3-5-sonnet-20240620
Copyright © Arsturn 2024