Skip to main content

A logger for tracking your agent workflow

Project description

ExtensiTrace

Python Package for Agent Workflow Tracking

ExtensiTrace allows for a simple way to track all agent actions including python functions and all openai tool calls.

Install from PyPI

pip install extensitrace

Usage

from extensitrace import ExtensiTrace

client = OpenAI() # Optional to pass in
connector = MongoConnector(...) # Optional connector, defaults to local
# Logger writes to a jsonl file locally by default 
et: ExtensiTrace = ExtensiTrace(connector=connector) # See constructor in extensitrace/extensitrace.py for more info

# Need track=True for top level
et.log(track=True)
def top_level_func():
    lower_level_func()
    
et.log()
def lower_level_func():
    pass

Notes to keep in mind

  • Tracks one openai call per function
  • Streaming openai calls not captured - the tracer is meant for tracking tool calls
  • Support for Openai only right now
  • The client objects should be the same across files if it is being passed in manually
  • Singleton class, however instantiation methods across files must match, recommend creating and importing from a file (see example below)
  • If this is very useful to you and want to use it in prod I'm happy to write an async interface for log dumps

Recommended Setup

tracer.py

from extensitrace import ExtensiTrace

et: ExtensiTrace = ExtensiTrace(connector=connector) 

main.py

from tracer import et

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

extensitrace-0.0.2.tar.gz (12.2 kB view hashes)

Uploaded Source

Built Distribution

extensitrace-0.0.2-py3-none-any.whl (13.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page