Skip to main content

TraceRazor callback adapter for CrewAI — automatic token efficiency auditing

Project description

tracerazor-crewai

CrewAI callback adapter for TraceRazor.

Automatically captures every task execution and tool call from your CrewAI crew with zero manual instrumentation.

Install

pip install tracerazor-crewai
pip install tracerazor-crewai[crewai]  # includes crewai

Requires the tracerazor binary:

cargo build --release
export TRACERAZOR_BIN=/path/to/TraceRazor/target/release/tracerazor

Usage

from tracerazor_crewai import TraceRazorCallback
from crewai import Agent, Task, Crew

callback = TraceRazorCallback(
    agent_name="support-crew",
    threshold=70,
)

crew = Crew(
    agents=[...],
    tasks=[...],
    callbacks=[callback],
)

crew.kickoff()

# After the crew finishes:
report = callback.analyse()
print(report.markdown())

# CI/CD gate — raises AssertionError if TAS < threshold:
callback.assert_passes()

API

TraceRazorCallback(agent_name, framework, threshold, task_value_score, tracerazor_bin)

param default description
agent_name "crewai-crew" shown in all reports
framework "crewai" framework label
threshold 70.0 minimum TAS for assert_passes()
task_value_score 1.0 answer quality (0–1)
tracerazor_bin auto path to binary; falls back to TRACERAZOR_BIN env var

callback.analyse() → TraceRazorReport

Finalise and submit the trace. Returns the report.

callback.assert_passes()

Raise AssertionError if TAS < threshold.

callback.set_task_value_score(score: float)

Update quality score before calling analyse().

Captured events

CrewAI event TraceRazor step type
on_task_start / on_task_end reasoning
on_agent_action reasoning or tool_call
on_tool_use_start / on_tool_use_end tool_call (success)
on_tool_error tool_call (failure → TCA misfire)

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

tracerazor_crewai-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

tracerazor_crewai-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file tracerazor_crewai-0.1.0.tar.gz.

File metadata

  • Download URL: tracerazor_crewai-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for tracerazor_crewai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6145741c439742bebfb082e37b3fbafe6c0968270ccf05a5190d39a35dc2f173
MD5 5ce8faaeb1cf25443e31228c9a16e8f1
BLAKE2b-256 b91108c3f25bc7299439fbef5ef25a02fb44901dc5cd6b73b2f155e336d94118

See more details on using hashes here.

File details

Details for the file tracerazor_crewai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tracerazor_crewai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5471d178f33b59c7105aa646056113fb5d062c742084b0f87e2b5e5307dbd0ac
MD5 ef5bacb6baf1617bf12c955b0fa57276
BLAKE2b-256 13cbd326e061322aa8fc8fc8bc261fd1a3c1d8d1976576cb237f7570b253b862

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