TraceAgent SDK
Python SDK for instrumenting AI agents and streaming events to a TraceAgent backend.
Install
pip install trace-agent-sdk
Usage
from trace_agent_sdk import TraceAgentClient
client = TraceAgentClient("http://localhost:8000")
run = client.start_run("my-agent", "Do something")
@run.tool()
def search(query: str) -> str:
return f"Results for {query}"
result = run.create_model_turn(
messages=[{"role": "user", "content": "Search for Python"}],
model="gpt-4",
)
run.finish()
File and command wrappers
# Record a command execution
run.commands.run(["python", "-m", "pytest"], cwd="./my-project")
# Record file operations
run.files.read_text("config.yaml")
run.files.write_text("output.txt", "hello world")
run.files.patch_text("app.py", "print('fixed')\n")
License
MIT
Metadata
Release files for trace-agent-sdk 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| trace_agent_sdk-0.0.3.tar.gz | 8.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| trace_agent_sdk-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.8 kB
Release files / trace_agent_sdk-0.0.3.tar.gz
| Download URL | trace_agent_sdk-0.0.3.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d691dd2a3a0d928087614e9542d07e9fd210b88ae05ed5f8e078ba21962baab5
|
|
BLAKE2b-256 checksum How to use checksums |
33b0265da5e8fc40ac735be3cf34257565ecb231a15a2f53b2d2c10d02aa6954
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / trace_agent_sdk-0.0.3-py3-none-any.whl
| Download URL | trace_agent_sdk-0.0.3-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
727bddbcc629b63f244cd8f44a5e87c89ed8f07f6ae6535b8567e6ada63a6784
|
|
BLAKE2b-256 checksum How to use checksums |
6bb058fd32aaef1748f2c165f5120f3cdfe4df8a888bc7704334f566c34b22c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|