A client library for accessing InteractiveAI
Project description
InteractiveAI Python SDK
The official Python SDK for InteractiveAI - an observability platform for LLM applications. This SDK provides tracing, automatic instrumentation for popular LLM frameworks, and direct API access to InteractiveAI's features.
Installation
From PyPI (Production)
Install the latest stable release:
pip install interactiveai
With optional integrations:
# With OpenAI instrumentation
pip install "interactiveai[openai]"
In requirements.txt:
interactiveai>=4.0.0
# or with extras
interactiveai[openai]>=4.0.0
In pyproject.toml (pip/uv):
[project]
dependencies = [
"interactiveai>=4.0.0",
]
# or with extras
[project.optional-dependencies]
llm = ["interactiveai[openai]>=4.0.0"]
From GitHub (Internal Development)
Install a specific tagged version:
pip install git+https://github.com/InteractiveAI/interactiveai-python-sdk.git@v4.1.0.dev1
Install from the main branch:
pip install git+https://github.com/InteractiveAI/interactiveai-python-sdk.git@main
In requirements.txt:
# Specific tag
interactiveai @ git+https://github.com/InteractiveAI/interactiveai-python-sdk.git@v4.1.0.dev1
# Main branch (latest)
interactiveai @ git+https://github.com/InteractiveAI/interactiveai-python-sdk.git@main
Quick Start
Basic Usage
from interactiveai import Interactive
# Initialize the client (uses environment variables by default)
client = Interactive()
# Create a trace
trace = client.trace(name="my-llm-app")
# Create a span within the trace
span = trace.span(name="llm-call")
# ... your LLM operations ...
# End the span with output
span.end(output={"response": "Hello, world!"})
# Flush to ensure all data is sent
client.flush()
Using the @observe Decorator
from interactiveai import observe
@observe()
def my_llm_function(prompt: str) -> str:
# Your LLM logic here
response = call_llm(prompt)
return response
# The function is automatically traced
result = my_llm_function("Hello!")
OpenAI Integration
from interactiveai.openai import openai
# Use openai as normal - all calls are automatically traced
response = openai.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
Configuration
The SDK is configured via environment variables:
| Variable | Description | Default |
|---|---|---|
INTERACTIVEAI_PUBLIC_KEY |
Your InteractiveAI public API key | Required |
INTERACTIVEAI_SECRET_KEY |
Your InteractiveAI secret API key | Required |
INTERACTIVEAI_HOST |
API endpoint URL | https://cloud.interactive.ai |
INTERACTIVEAI_DEBUG |
Enable debug logging | false |
INTERACTIVEAI_TRACING_ENABLED |
Enable/disable tracing | true |
INTERACTIVEAI_SAMPLE_RATE |
Sampling rate for traces (0.0-1.0) | 1.0 |
Documentation
For detailed documentation, guides, and API reference, visit:
- SDK Documentation
- API Reference
- Migration Guide - For users migrating from other observability SDKs
License
MIT License - see LICENSE for details.
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
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 interactiveai-1.1.6.tar.gz.
File metadata
- Download URL: interactiveai-1.1.6.tar.gz
- Upload date:
- Size: 280.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09d712d90ee69ec4c74ac1df86c90b813affa4c2b1ec714736b9003ec4f6f2f7
|
|
| MD5 |
7279949f1f5705763ca045dfb788fb7e
|
|
| BLAKE2b-256 |
56cc20ed9f067ef4a366f20c2105647cf0d77d709aa8a7ce233306c16f4e151c
|
Provenance
The following attestation bundles were made for interactiveai-1.1.6.tar.gz:
Publisher:
release.yml on Interactive-AI-Labs/interactiveai-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interactiveai-1.1.6.tar.gz -
Subject digest:
09d712d90ee69ec4c74ac1df86c90b813affa4c2b1ec714736b9003ec4f6f2f7 - Sigstore transparency entry: 1718873232
- Sigstore integration time:
-
Permalink:
Interactive-AI-Labs/interactiveai-python-sdk@c808ab8258f87ef140105c36ef9a08300ccd6dcf -
Branch / Tag:
refs/tags/v1.1.6 - Owner: https://github.com/Interactive-AI-Labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c808ab8258f87ef140105c36ef9a08300ccd6dcf -
Trigger Event:
push
-
Statement type:
File details
Details for the file interactiveai-1.1.6-py3-none-any.whl.
File metadata
- Download URL: interactiveai-1.1.6-py3-none-any.whl
- Upload date:
- Size: 489.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da72b38076f68bd5d2e12a1484d68f94cbb7bf9e3db2443f6f2ae5920689c209
|
|
| MD5 |
ddc1461d0e2b82e69911974e3f01d6f1
|
|
| BLAKE2b-256 |
72017740bbd3c894daa24504aff24270125dabab41f0faeead7a75fca172b23c
|
Provenance
The following attestation bundles were made for interactiveai-1.1.6-py3-none-any.whl:
Publisher:
release.yml on Interactive-AI-Labs/interactiveai-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interactiveai-1.1.6-py3-none-any.whl -
Subject digest:
da72b38076f68bd5d2e12a1484d68f94cbb7bf9e3db2443f6f2ae5920689c209 - Sigstore transparency entry: 1718873321
- Sigstore integration time:
-
Permalink:
Interactive-AI-Labs/interactiveai-python-sdk@c808ab8258f87ef140105c36ef9a08300ccd6dcf -
Branch / Tag:
refs/tags/v1.1.6 - Owner: https://github.com/Interactive-AI-Labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c808ab8258f87ef140105c36ef9a08300ccd6dcf -
Trigger Event:
push
-
Statement type: