Claude is Anthropic’s family of large language models. Claude 3.5 provides an alternative to OpenAI models and can be used through a web interface or a Python library. section 8.0 section 8.1
Anthropic distinguishes its training approach through Constitutional AI: a set of rules guides a second AI in evaluating generated answers for accuracy and harmlessness. section 8.1
Use Claude in two practical ways:
- Chat through Anthropic’s website after creating and verifying an account. section 8.1.1
- Call Claude from Python by installing the Anthropic library, creating an access key, and passing a question to the anthropic.messages endpoint. section 8.1.2
- Configure the model identifier, maximum completion tokens, and a list of chat messages, then read the returned content. section 8.1.2
A first Claude task
Open Claude’s chat interface and ask it to classify reviews by sentiment or translate a natural-language question into a SQL query. The same kind of question can be supplied through the Python interface. section 8.1.1 section 8.1.2
Figure 8.1 Web interface for Anthropic’s chatbot Claude
View the web interface used to start a conversation with Claude. section 8.1.1


