-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AgentOps integration issues with the limited info exposed in the SessionEventHandler
class
#445
Comments
@liqul here you will find the documentation of the AgentOps platform and the challenges in integrating TaskWeaver with it. |
To explain some context:
For now, The hard part is the ToolEvent. Currently, we only track the code snippet execution as a whole, and you may know that each tool is a python function call in the code. The dynamically generated code is also in the trace, but we do not support tracking individual function call during the execution. This part could be tricky to support as we do not assume that the code execution will always happen in the local enviroment. It could be inside a container or even on a remote server (though we haven't supported this feature yet), which means, to track the fine-grained execution time of each plugin, there is still quite a lot of effort on the infrastructure. So, in conclusion, I believe you can find most information from the traces, but I haven't any experiences in handling Opentelemetry traces. Since you have already get most of ActionEvents from |
I can experiment with the What kind of modifications are you thinking for the |
Hi @the-praxs, before modifying the |
I just got an idea to monkey patch the A permanent solution will involve collecting traces from open-telemetry which I plan to add later. |
@liqul I made a patch to the LLM service's |
Sounds great! Really appreciate your work on the integration. |
Thanks. Opened a PR for docs too - #448 |
Is your feature request related to a problem? Please describe.
I am using AgentOps as my agent observability platform, and I'm trying to build a TaskWeaver integration. Currently there are some blockers that prevent TaskWeaver from exporting the required information to AgentOps.
What is AgentOps?
AgentOps is a platform for tracking and analyzing the interactions between users and AI agents. It provides a python SDK for tracking the analytics of AI agents. and a dashboard for visualization of the collected data.
The docs are available here and the Github repo is available here.
Challenges integrating TaskWeaver with AgentOps
This PR is using the
SessionEventHandler
class to track the analytics of the TaskWeaver app. We want to track the information about different events in the TaskWeaver app i.e. theSession
, theRound
and thePost
by mapping them to the AgentOps events -ActionEvent
,LLMEvent
,ToolEvent
, and an additionalErrorEvent
for reporing errors during tracking of any aforementioned events.However, the following caveats are observed:
SessionEventHandler
class, we are able to track most of the information except those of the LLM calls and the associated Tool calls. Since thesend_message
function is not handled by theSessionEventHandler
class, the user query is not available for tracking. Similarly, thetaskweaver_config.json
file is not being tracked as theapp_dir
variable is not available in theSessionEventHandler
class.openai
,anthropic
etc) but TaskWeaver uses a custom wrapper around the LLM provider libraries using aCompletionService
class. I made an attempt to patch theCompletionService
class for each LLM provider in TaskWeaver to track the LLM calls, but no information was captured.Tracing
module which is a wrapper around theopentelemetry
library. However, I see no detailed documentation on modifying this class to use a different tracing backend.Describe the solution you'd like
From my observations, the TaskWeaver app is using the
Injector
library to manage the dependency injections in the codebase. The following proposed solutions are based on this observation:Injector
class to inject the AgentOps python SDK so that theSessionEventHandler
class can track the analytics of the TaskWeaver app.CompletionService
class to track the LLM calls and the associated Tool calls.Tracing
class to use a different tracing backend.Alternatively, I would like to know if we can expose the information ranging from the user query to the LLM provider used in the
SessionEventHandler
class so that we can track the analytics using the AgentOps python SDK.Describe alternatives you've considered
One of the ways is to pass the
Session
object to the AgentOps handler directly and extract the required information. This is not a clean solution as changes to the TaskWeaver codebase would break the integration and thus affect scalability.Additional context
Here is the code I used to track the analytics of the TaskWeaver app:
This video will demonstrate the tracking on the AgentOps dashboard.
The text was updated successfully, but these errors were encountered: