A Python wrapper for various AI language model APIs
Project description
APILens
A Python wrapper for various AI language model APIs that provides consistent interface, logging, and cost tracking across different providers.
Features
- Unified interface for multiple AI providers
- Automatic retry mechanism with exponential backoff
- Usage tracking and cost calculation
- SQLite-based logging system
- Support for both synchronous and asynchronous operations
- Streaming support
Installation
pip install apilens
Usage
from apilens import BaseAIWrapper
# Initialize your provider wrapper
wrapper = YourProviderWrapper(
provider_name="your_provider",
model="your_model",
user_id="optional_user_id",
tenant_id="optional_tenant_id"
)
# Make a chat completion request
response = wrapper.chat_completion([
{"role": "user", "content": "Hello, how are you?"}
])
License
MIT License
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
apilens-0.1.0.tar.gz
(10.4 kB
view details)
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
apilens-0.1.0-py3-none-any.whl
(11.8 kB
view details)
File details
Details for the file apilens-0.1.0.tar.gz.
File metadata
- Download URL: apilens-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b781bb02a9e78e2cb050ea7f1c226ab183fee87ef177079b6dc06fd953159c51
|
|
| MD5 |
49a18e0c9a55a0d5a14873f3b4af153c
|
|
| BLAKE2b-256 |
30676797094fe88c9e962554096df8be25d48fb22c10582b3440a27422bd99aa
|
File details
Details for the file apilens-0.1.0-py3-none-any.whl.
File metadata
- Download URL: apilens-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4573c9797a3cfd29f41fba8645dae2067e6780ad4f98e4c4adb581e20df847d
|
|
| MD5 |
33ead815382ec734348fe9f5fb59d77e
|
|
| BLAKE2b-256 |
98e3704ad9eca0c98ca152ff24044b84918e4bc59cdcf3879d9080ae2ca0e3ba
|