Skip to main content

AI agent observability SDK supporting 25 trace formats

Project description

ThinkHive Python SDK

OpenTelemetry-based observability SDK for AI agents supporting 25 trace formats including LangSmith, Langfuse, Opik, Braintrust, Datadog, MLflow, and more.

Installation

pip install thinkhive

Quick Start

import thinkhive

# Initialize SDK
thinkhive.init(
    api_key="your-api-key",  # or set THINKHIVE_API_KEY
    service_name="my-ai-agent"
)

# Trace LLM calls
@thinkhive.trace_llm(model_name="gpt-4", provider="openai")
def call_llm(prompt):
    response = openai.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": prompt}]
    )
    return response

# Trace retrieval operations
@thinkhive.trace_retrieval()
def search_documents(query):
    results = vector_db.search(query)
    return results

# Trace tool calls
@thinkhive.trace_tool(tool_name="web_search")
def search_web(query):
    return requests.get(f"https://api.example.com/search?q={query}")

Environment Variables

  • THINKHIVE_API_KEY: Your ThinkHive API key
  • THINKHIVE_AGENT_ID: Your agent ID (alternative to API key)

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

thinkhive-0.2.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

thinkhive-0.2.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file thinkhive-0.2.0.tar.gz.

File metadata

  • Download URL: thinkhive-0.2.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for thinkhive-0.2.0.tar.gz
Algorithm Hash digest
SHA256 626874898e72aa53a4d9b91b45aabd97133cab0a6507f71278be1e43e8964ad4
MD5 792651761be6468eb049e80b54d50715
BLAKE2b-256 6aa93bd3abe3bb3e99652edd72402666933acc8dafc6c68d89063469201e33f4

See more details on using hashes here.

File details

Details for the file thinkhive-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: thinkhive-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for thinkhive-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 697aa2a03d7bdef83970ec63758820e8ecfcb34cef5de87f9d82a35ca828a0b3
MD5 42fd06ced117174a80f441ed5cc42e4e
BLAKE2b-256 521d186ae4b47fa503d942bf5e6f80400ecde6053836fca955bda6262854ea6f

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