AgentOps-AI / AgentOps-AI/agentops

[Bug]: LiteLLM Instrumentation not working for Responses API

Đang mở
#1,028 2 bình luận 0 reaction 1 người được giao Được @fenilfaldu nhận Xem trên GitHub
bug good first issue
Ngôn ngữ chính
Python
Star
5.8k
Fork
619
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Contact Details

_No response_

### 📦 Package Version

0.4.14

### 🎞️ Framework Version

1.72.0

### 🔎 Describe the Bug

Neither normal instrumentation with LiteLLM or using the success_callback arg are working properly for LiteLLM for `litellm.response` (they work for `litellm.completions`).
Success callback not working (see docs https://docs.litellm.ai/docs/observability/agentops_integration):

```
In [1]: import agentops
i
In [2]: import litellm

In [3]: litellm.success_callback = ["agentops"]

In [4]: agentops.init(auto_start_session=False)
...:

In [5]:
...:
...: # Non-streaming response
...: response = litellm.responses(
...: model="openai/gpt-4o",
...: input="Tell me a three sentence bedtime story about a unicorn.",
...: max_output_tokens=100
...: )
...:
...: print(response)
````
-> No trace detected in AgentOps dashboard

As well as normal instrumentation:
```
In [3]: agentops.init()
🖇 AgentOps: Session Replay for default trace: https://app.agentops.ai/sessions?trace_id=24108c993e0f3b8b4d20b3e0b7e96c06
Out[3]:

In [4]: import litellm

In [5]:
...: # Non-streaming response
...: response = litellm.responses(
...: model="openai/gpt-4o",
...: input="Tell me a three sentence bedtime story about a unicorn.",
...: max_output_tokens=100
...: )
...:
...: print(response)
```

TODO:
1. Fix instrumentation
2. Update AgentOps docs if required
3. Raise a PR and update LiteLLM's AgentOps docs if required

### 🤝 Contribution

- [ ] Yes, I'd be happy to submit a pull request with these changes.
- [ ] I need some guidance on how to contribute.
- [ ] I'd prefer the AgentOps team to handle this update.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.