Official Libra AI SDK for Python
Project description
libra-ai-sdk
Official Libra AI SDK for Python.
Installation
pip install libra-ai-sdk
Quick Start
from libra_ai import LibraAI
libra = LibraAI('lak_your_api_key')
# Simple usage
answer = libra.ask('What is Python?')
print(answer)
# With options
response = libra.chat(
'Explain machine learning',
temperature=0.5,
max_tokens=1000
)
print(response['data']['message'])
API Reference
Constructor
LibraAI(api_key: str, base_url: str = 'https://libra-ai.com')
api_key- Your Libra API key (starts withlak_)base_url- Optional custom base URL
Methods
chat(message, **options)
Send a message and get the full response object.
response = libra.chat(
'Hello!',
model='default',
max_tokens=2048,
temperature=0.7,
system_prompt='You are a helpful assistant'
)
ask(message, **options)
Simple method that returns just the AI response as a string.
answer = libra.ask('What is AI?')
get_info()
Get API info and rate limits.
info = libra.get_info()
Rate Limits
| Tier | Requests/min | Requests/day | Max Tokens |
|---|---|---|---|
| Basic | 10 | 100 | 2048 |
| Pro | 60 | 1000 | 8192 |
Requirements
- Python >= 3.8
- requests >= 2.25.0
License
MIT © IndoNusaCorp
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
libra_ai_sdk-2.0.0.tar.gz
(4.2 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
File details
Details for the file libra_ai_sdk-2.0.0.tar.gz.
File metadata
- Download URL: libra_ai_sdk-2.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58da6354a1c5081fd5f601a4606b6679e3a652304f1d95b380b658b655f59396
|
|
| MD5 |
02e348f76dcf992445591b5cec186afd
|
|
| BLAKE2b-256 |
a391d11e79cf142ee345d5c3502de9f3f1d4c9ee7c720278d4da4ca1ad49a117
|
File details
Details for the file libra_ai_sdk-2.0.0-py3-none-any.whl.
File metadata
- Download URL: libra_ai_sdk-2.0.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5aef7e980409c98df3e25976b5e45890f49d3bdda193b7b5f892b56971829ef1
|
|
| MD5 |
f8a527b1d5ee3eca950a94d319eb92e4
|
|
| BLAKE2b-256 |
28384cec6330ec2e7cfc663593bc23e5b81835ff3f4e021f1f909d1e3efe3ab9
|