Skip to main content

TraceAgent SDK for instrumenting AI agents.

Project description

TraceAgent SDK

GitHub Release GitHub Stars GitHub License Tests

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


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.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

trace_agent_sdk-0.0.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trace_agent_sdk-0.0.2.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for trace_agent_sdk-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6c826451003e422025f8c57fe5bb5d1168d40ad388935b095dc63470d278f113
MD5 1bfe74dad576df9125129726639e30da
BLAKE2b-256 0571ecaa597b7c6e8d3f91ee21a6a5508e913f3076ab6bf504ff2005a42eabd1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trace_agent_sdk-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for trace_agent_sdk-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04362419a81bff5b3eb998c2aa6a470f2411acbc38e6b8f7893a753071bd77d5
MD5 d2cd20662aaced7106be48f4f532301b
BLAKE2b-256 92756f204d809155f1dc00a4a22cc0b48b5b1cc8bf3abb7f7f07cdf4e54120f8

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