Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
# WhiteBoxAI Python SDK - Environment Variables Template
# WhiteBoxXAI Python SDK - Environment Variables Template
#
# Only the two variables below are actually read from the environment by
# the SDK (see whiteboxxai/config.py). Everything else (offline mode,
# caching, privacy filters, sampling) is configured via WhiteBoxXAI()
# constructor keyword arguments instead — see README.md.

# API Configuration
EXPLAINAI_API_KEY=your-api-key-here
EXPLAINAI_BASE_URL=https://api.whiteboxai.io

# Offline Mode (Optional)
EXPLAINAI_ENABLE_OFFLINE=true
EXPLAINAI_OFFLINE_DIR=./whiteboxai_offline
EXPLAINAI_OFFLINE_AUTO_SYNC=true

# Privacy & Security (Optional)
EXPLAINAI_ENABLE_PRIVACY_FILTERS=true

# Caching (Optional)
EXPLAINAI_ENABLE_CACHING=true
EXPLAINAI_CACHE_TTL=3600

# Sampling (Optional)
EXPLAINAI_SAMPLING_RATE=1.0
WHITEBOXXAI_API_KEY=your-api-key-here
WHITEBOXXAI_BASE_URL=https://api.whiteboxxai.com
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ jobs:

- name: Run flake8 linter
run: |
flake8 src/ tests/ examples/ --count --statistics --max-line-length=120
flake8 whiteboxxai/ tests/ examples/ --count --statistics --max-line-length=120

- name: Run pylint
run: |
pylint src/ --exit-zero --score=yes
pylint whiteboxxai/ --exit-zero --score=yes

- name: Run security check (Bandit)
run: |
bandit -r src/ -f json -o bandit-report.json || true
bandit -r whiteboxxai/ -f json -o bandit-report.json || true

- name: Upload Bandit report
uses: actions/upload-artifact@v4
Expand All @@ -62,7 +62,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout code
Expand All @@ -81,7 +81,7 @@ jobs:

- name: Run unit tests
run: |
pytest tests/unit -v --cov=src/whiteboxai --cov-report=xml
pytest tests/unit -v --cov=whiteboxxai --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
77 changes: 76 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,87 @@
# Changelog

All notable changes to the WhiteBoxAI Python SDK will be documented in this file.
All notable changes to the WhiteBoxXAI Python SDK will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.0] - 2026-07-14

First stable, production release. This release realigns the SDK with the
`whiteboxxai.com` product branding and folds in the fixes/features
developed in the `whitebox-xai-azure` monorepo's `sdk/` directory.

### Changed
- **BREAKING**: Rebranded from `whiteboxai`/`whiteboxai-sdk` (single "x",
`whiteboxai.io`/`whitebox.agentaflow.com`) to `whiteboxxai`/`whitebox-xai-sdk`
(double "x", `whiteboxxai.com`). Update imports: `from whiteboxai import ...`
→ `from whiteboxxai import ...`; update the install command to
`pip install whitebox-xai-sdk`; update the `EXPLAINAI_*` env vars to
`WHITEBOXXAI_*` (`WHITEBOXXAI_API_KEY`, `WHITEBOXXAI_BASE_URL`).
- **BREAKING**: Switched from a `src/whiteboxai/` layout to a flat
`whiteboxxai/` layout at the repository root, matching the canonical
source in `whitebox-xai-azure/sdk/`. Removed the legacy `setup.py`;
`pyproject.toml` is now the single build configuration.
- Version is now read from installed package metadata
(`importlib.metadata.version("whitebox-xai-sdk")`) instead of being
hardcoded in three separate places.
- `Development Status` classifier bumped from Beta to Production/Stable.
- `ModelMonitor.log_prediction()`/`alog_prediction()`/`log_batch()` now call
the predictions API with the correct `input_data`/`output_data` field
names (previously sent `inputs`/`outputs`, which the real API doesn't
accept).

### Added
- `ModelMonitor` local buffering (`buffer_size=`) with `flush()`/`aflush()`
and context-manager support (`with ModelMonitor(...) as monitor:`
flushes on exit).
- `ModelMonitor.get_prediction_count()`, `get_drift_reports()`,
`create_alert_rule()`, and `get_active_alerts()` convenience methods.
- `log_prediction(explain=True)` now actually triggers explanation
generation via the explanations resource, instead of silently
accepting and dropping the flag.
- SDK exception classes (`APIError`, `AuthenticationError`, `RateLimitError`,
`ValidationError`, `NotFoundError`) now carry structured metadata
(`status_code`, `response`, `request_id`, `retry_after`, `fields`, etc.)
instead of being bare, attribute-less `Exception` subclasses.
- `Config` now validates `timeout`/`max_retries` are positive.
- MCP (Model Context Protocol) usage documented in `README.md` for
non-Python integrations, pointing at the companion `whiteboxxai-mcp`
package.
- `LICENSE` file (MIT), matching `pyproject.toml`'s declared license.

### Fixed
- Fixed an import-time crash: `whiteboxxai.integrations` (and therefore the
whole SDK) failed to import for anyone without PyTorch or TensorFlow
installed, due to bad optional-dependency fallback stubs in
`integrations/pytorch.py` and `integrations/tensorflow.py`, and an
unguarded/unbound name in `integrations/langchain.py`.
- `README.md` code samples fixed throughout: wrong import path
(`whiteboxai` → `whiteboxxai`), wrong class name (`WhiteBoxAI` →
`WhiteBoxXAI`), and wrong install command.
- Corrected `WhiteBoxXAI_*`-cased env var references (wrong case, and in
one place the wrong variable name entirely) to the real
`WHITEBOXXAI_API_KEY`/`WHITEBOXXAI_BASE_URL` across guides and examples.
- `docs/` guides (`api-reference.md`, `getting-started.md`, `index.md`,
`integrations.md`, `offline-mode.md`) rebranded from the stale
`whiteboxai.io`/`agentaflow.com`/`EXPLAINAI_*` naming.

## [0.2.1] - 2026-05-03

No changelog entry was recorded for this release at the time. Reconstructed
from the git history between the `0.2.0` and `0.2.1` tags:

### Added
- `AgentWorkflows` resource and client binding for multi-agent workflow
tracking.

### Fixed
- e2e pytest exit-code handling.
- Import normalization and formatting cleanup across integrations and
examples.

## [0.2.0] - 2026-02-10

### Added
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 AgentaFlow
Copyright (c) 2026 WhiteBoxXAI Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ include CHANGELOG.md

# Include configuration files
include pyproject.toml
include setup.py
include pytest.ini
include .gitignore

Expand All @@ -22,7 +21,7 @@ recursive-include examples *.py
recursive-include tests *.py

# Include source package data
recursive-include src *.py
recursive-include whiteboxxai *.py

# Exclude compiled files
global-exclude *.py[cod]
Expand Down
Loading
Loading