huggingface / huggingface/agents-course

[HANDS-ON BUG] Unit 2.2 Error 401 because the LlamaTrace's api has changed

Open
#617 0 comments 0 reactions 0 assignees View on GitHub
hands-on-bug
Dominant language
MDX
Stars
32.6k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
the last code of "Unit 2.2 what are components in LlamIndex? " will get Error 401

**To Reproduce**
Run the code

**Screenshots**
"ERROR - Failed to export span batch code: 401, reason: "

**Additional context**
Reason: The API has changed. The following code works now.

```python
import os

# Import open-telemetry dependencies
from arize.otel import register

# Setup OTel via our convenience function
tracer_provider = register(
space_id = "your-space-id", # in app space settings page
api_key = "your-api-key", # in app space settings page
project_name = "your-project-name", # name this to whatever you would like
)
# Import the automatic instrumentor from OpenInference
from openinference.instrumentation.llama_index import LlamaIndexInstrumentor

# Finish automatic instrumentation
LlamaIndexInstrumentor().instrument(tracer_provider=tracer_provider)
```
Also, the dependency should be changed:

```
pip install arize-otel openai openinference-instrumentation-openai opentelemetry-exporter-otlp
```

You can find more information about the API here:
https://arize.com/docs/ax/quickstarts/quickstart-tracing#llamaindex

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.