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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file extensitrace-0.0.2.tar.gz.

File metadata

  • Download URL: extensitrace-0.0.2.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for extensitrace-0.0.2.tar.gz
Algorithm Hash digest
SHA256 53c23d924b1f13bb124a86afa9e1b3cf68e769fde97e9d04f2656e0ec79903de
MD5 dc4ee54ac3fc691a9a70398d0fd9ba9b
BLAKE2b-256 bcbc797137064ea6a1dd94b1eb28fdac2d16ca87a8e5064c7aeeab1502d2bf65

See more details on using hashes here.

File details

Details for the file extensitrace-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: extensitrace-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for extensitrace-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 967fedef5267f52722013845e18cc6d6811f63239a662819e56f6703d31fe573
MD5 84056ebf1adab89b524874313257755c
BLAKE2b-256 abdaec7f29c2da0b1f68545982bf3e87099d072bad6b28c7f255289536e4c80a

See more details on using hashes here.

Supported by

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