TraceAgent SDK for instrumenting AI agents.
Project description
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
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
trace_agent_sdk-0.0.3.tar.gz
(8.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trace_agent_sdk-0.0.3.tar.gz.
File metadata
- Download URL: trace_agent_sdk-0.0.3.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d691dd2a3a0d928087614e9542d07e9fd210b88ae05ed5f8e078ba21962baab5
|
|
| MD5 |
5222f26303a38eb684a40d170fd44dec
|
|
| BLAKE2b-256 |
33b0265da5e8fc40ac735be3cf34257565ecb231a15a2f53b2d2c10d02aa6954
|
File details
Details for the file trace_agent_sdk-0.0.3-py3-none-any.whl.
File metadata
- Download URL: trace_agent_sdk-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
727bddbcc629b63f244cd8f44a5e87c89ed8f07f6ae6535b8567e6ada63a6784
|
|
| MD5 |
ee4b046271ab31b2fb83ca0b664f3202
|
|
| BLAKE2b-256 |
6bb058fd32aaef1748f2c165f5120f3cdfe4df8a888bc7704334f566c34b22c1
|