Skip to content

Commit

Permalink
Fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieG committed May 15, 2024
1 parent ea6328d commit e5e2c71
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions agentops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def __init__(self,
self._tags: Optional[List[str]] = tags
self._tags_for_future_session: Optional[List[str]] = None


self._env_data_opt_out = os.getenv('AGENTOPS_ENV_DATA_OPT_OUT') and os.getenv(
'AGENTOPS_ENV_DATA_OPT_OUT').lower() == 'true'

Expand All @@ -97,7 +96,8 @@ def __init__(self,

self._handle_unclean_exits()

instrument_llm_calls, auto_start_session = self._check_for_partner_frameworks(instrument_llm_calls, auto_start_session)
instrument_llm_calls, auto_start_session = self._check_for_partner_frameworks(
instrument_llm_calls, auto_start_session)

if auto_start_session:
self.start_session(tags, self.config, inherited_session_id)
Expand All @@ -113,9 +113,12 @@ def _check_for_partner_frameworks(self, instrument_llm_calls, auto_start_session
for framework in partner_frameworks.keys():
if framework in sys.modules:
self.add_tags([framework])
if 'autogen':
import autogen
autogen.runtime_logging.start(logger_type="agentops")
if framework == 'autogen':
try:
import autogen
autogen.runtime_logging.start(logger_type="agentops")
except:
pass

return partner_frameworks[framework]

Expand Down Expand Up @@ -402,4 +405,5 @@ def parent_key(self):
return self.config.parent_key

def stop_instrumenting(self):
self.llm_tracker.stop_instrumenting()
if self.llm_tracker:
self.llm_tracker.stop_instrumenting()

0 comments on commit e5e2c71

Please sign in to comment.