Setup
- Install Langtrace’s SDK and initialize the SDK in your code.
Python
- Setup environment variables:
Shell
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Anthropic is an AI research organization behind Claude model family. Whether you’re brainstorming alone or building with a team of thousands, Claude is here to help.
# Install the SDK
pip install -U langtrace-python-sdk anthropic
export LANGTRACE_API_KEY=YOUR_LANGTRACE_API_KEY
export ANTHROPIC_API_KEY=YOUR_ANTHROPIC_API_KEY
# Imports import os
import os
from langtrace_python_sdk import langtrace # Must precede any llm module imports
langtrace.init(api_key = os.environ['LANGTRACE_API_KEY'])
from anthropic import Anthropic
client = Anthropic(
# This is the default and can be omitted
api_key=os.environ.get("ANTHROPIC_API_KEY"),
)
# Query Anthropic's claude-3-opus MODEL:
message = client.messages.create(
max_tokens=1024,
messages=[
{
"role": "user",
"content": "Hello, Claude",
}
],
model="claude-3-opus-20240229",
)
print(message)