agentops icon indicating copy to clipboard operation
agentops copied to clipboard

instrument_llm_calls=False + stop_instrumenting() will raise on missing llm_tracker

Open mbarnathan opened this issue 1 year ago • 0 comments

🐛 Bug Report

🔎 Describe the Bug If you start up an agentops client with instrument_llm_calls false and stop_instrumenting() gets called, whether implicitly via Crew/Autogen or explicitly by the caller, client.py will try to reference an undefined self.llm_tracker member and throw. (Even though it is checked for truthiness, only getattr/hasattr will work when the value isn't set at all)

The fix is to explicitly set llm_tracker to None in the constructor, which will make the check later work properly with a falsy value. I will submit a fix.

mbarnathan avatar Jun 14 '24 04:06 mbarnathan