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.3.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.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

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

Hashes for trace_agent_sdk-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d691dd2a3a0d928087614e9542d07e9fd210b88ae05ed5f8e078ba21962baab5
MD5 5222f26303a38eb684a40d170fd44dec
BLAKE2b-256 33b0265da5e8fc40ac735be3cf34257565ecb231a15a2f53b2d2c10d02aa6954

See more details on using hashes here.

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

Hashes for trace_agent_sdk-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 727bddbcc629b63f244cd8f44a5e87c89ed8f07f6ae6535b8567e6ada63a6784
MD5 ee4b046271ab31b2fb83ca0b664f3202
BLAKE2b-256 6bb058fd32aaef1748f2c165f5120f3cdfe4df8a888bc7704334f566c34b22c1

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