AgentOps-AI / agentops

Python SDK for agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks like CrewAI, Langchain, and Autogen
https://agentops.ai
MIT License
1.23k stars 97 forks source link

Add LlamaIndex callback handler #66

Open areibman opened 6 months ago

areibman commented 6 months ago

🚀 Feature Request

💡 Got a brilliant idea? Similar to Langchain, Llama Index also provides callback handlers. This is a potential opportunity to give built-in observability to agents built with this framework.

🤔 Is your feature request related to a problem? A user in TokenCost might be a good initial pilot.

🎉 Describe the solution you'd like Implement the callback handler here: https://docs.llamaindex.ai/en/stable/api_reference/callbacks.html

🔍 Additional context Before working on this, find at least a handful of LlamaIndex agent builders and trial with them

Alchemist1411 commented 4 months ago

Hey, does the new LlamaIndex_callback_handler should mimic the langchain_callback_handler which is already present ?

areibman commented 4 months ago

Hey, does the new LlamaIndex_callback_handler should mimic the langchain_callback_handler which is already present ?

You can read more about the LlamaIndex callback handler here: https://docs.llamaindex.ai/en/stable/module_guides/observability/callbacks/root.html#modules

The idea is this: Every time an LLM operation occurs, LlamaIndex can fire off a series of callback events. On each callback, we'd like to capture that information as an AgentOps Event and record it with the client. You can look at the Langchain callback handler in the AgentOps repo to get a better idea of how this works