Unify
Thin Python SDK wrapping the Orchestra REST API. Provides functional utilities for logging, project management, and assistant operations.
This package is used as a dependency by higher-level frameworks like Unity.
Installation
pip install unifyai
Or add to your project's dependencies pointing to this repo.
Configuration
Set your API key via environment variable:
export UNIFY_KEY=<your-api-key>
Optionally override the API base URL (defaults to https://api.unify.ai/v0):
export UNIFY_BASE_URL=https://api.unify.ai/v0
Core API
Projects
import unify
# Activate a project (creates if doesn't exist)
unify.activate("my-project")
# Or manage projects directly
unify.create_project("my-project")
unify.list_projects()
unify.delete_project("my-project")
Logging
import unify
unify.activate("my-project")
# Log entries
unify.log(question="What is 2+2?", response="4", score=1.0)
# Retrieve logs
logs = unify.get_logs()
Parallel Mapping
import unify
def process(item):
# ... do work ...
unify.log(item=item, result=result)
unify.map(process, items)
Project Structure
unify/
├── __init__.py # Public API exports
├── assistants/ # Assistant management
│ └── management.py
├── logging/ # Logging functionality
│ ├── logs.py # Core Log class
│ └── utils/ # Logging utilities
│ ├── contexts.py # Context management
│ ├── logs.py # Log CRUD operations
│ └── projects.py # Project CRUD operations
├── platform/ # Platform API
│ ├── queries.py # Query logging
│ └── user.py # User info
└── utils/ # Shared utilities
├── http.py # HTTP client
├── storage.py # Object storage
├── map.py # Parallel mapping
├── helpers.py # Misc helpers
└── caching/ # Cache backends
Local Development
This project uses Poetry for dependency management.
Setup
poetry install
Running Tests
poetry run pytest tests/path/to/test.py -v
If you encounter Project _ not found errors during test startup, unset the CI variable:
CI= poetry run pytest tests/path/to/test.py -v
Pre-commit Hooks
Pre-commit hooks run automatically on git commit (Black, isort, autoflake). If a commit fails due to auto-formatting, re-run the commit.
Metadata
Release files for unifyai 0.9.191
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| unifyai-0.9.191.tar.gz | 40.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| unifyai-0.9.191-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 90.0 kB
Release files / unifyai-0.9.191.tar.gz
| Download URL | unifyai-0.9.191.tar.gz |
|---|---|
| Size | 40.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d61aa4531fa18f7508184dcacc702d0c7a85e42df4c1afc0ad1a5e662a037264
|
|
BLAKE2b-256 checksum How to use checksums |
8b26d0ba4a3e2e5e8b3f6d09c1a2ff4f12d954c78a7f847a6831ebd51eaa2ef8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.9.25 Linux/6.11.0-1018-azure
|
Release files / unifyai-0.9.191-py3-none-any.whl
| Download URL | unifyai-0.9.191-py3-none-any.whl |
|---|---|
| Size | 49.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32713388b056a1421a37f2e1ed6379db0e4422efc8fb33b714b566c50f82daa6
|
|
BLAKE2b-256 checksum How to use checksums |
24f52bc2eb60ebeddc1281fbd9251fcb6b3c18b20d407008ceedf43e351b1798
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.9.25 Linux/6.11.0-1018-azure
|