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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for extensitrace-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 967fedef5267f52722013845e18cc6d6811f63239a662819e56f6703d31fe573 |
|
MD5 | 84056ebf1adab89b524874313257755c |
|
BLAKE2b-256 | abdaec7f29c2da0b1f68545982bf3e87099d072bad6b28c7f255289536e4c80a |