AgentOps-AI / AgentOps-AI/agentops

[Bug]: Broken viz in Agent Ops Traces when using with_structured_output

未關閉
#1,263 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Python
星號
5.8k
分支
619
PR 合併指標
30 天內沒有已合併 PR

描述

### Contact Details

_No response_

### 📦 Package Version

agentops==0.4.21

### 🎞️ Framework Version

_No response_

### 🔎 Describe the Bug

from agentops.integration.callbacks.langchain import LangchainCallbackHandler
from langchain_openai import ChatOpenAI
from src.settings import settings
handler = LangchainCallbackHandler(api_key=settings.agentops_api_key, tags=['LangChain Example'])

chat_model = ChatOpenAI(
model_name="gpt-4o-2024-08-06",
base_url="https://eu.api.openai.com/v1",
api_key=settings.openai_api_key,
temperature=0,
callbacks=[handler],
)

llm_with_structured_output = chat_model.with_structured_output(Score)
message_str = json.dumps(data, ensure_ascii=False)
prompt = PROMPT.format(info=message_str)
response = await llm_with_structured_output.ainvoke(prompt)

Image

### 🤝 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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。