Anthropic
Instrument LLM calls made using Anthropic's SDK
Anthropic is a leading provider for state-of-the-art LLMs. The Anthropic SDK can be instrumented using the openinference-instrumentation-anthropic
package.
In this example we will instrument a small program that uses the Anthropic chat completions API and observe the traces in Arize.
Copy
Set the ANTHROPIC_API_KEY
environment variable to authenticate calls made using the SDK.
Copy
In a python file, setup the AnthropicInstrumentor
and configure the tracer to send traces to Arize.
Copy
To test, run the following code and observe your traces in Arize.
Copy
Last updated
Was this helpful?