Skip to main content

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 with lak_)
  • 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-1.0.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libra_ai_sdk-1.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file libra_ai_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: libra_ai_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for libra_ai_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a7576a7490923c9bc08c530df41e9c94e92e9e25e18ecc2b0b533cd917e8aeca
MD5 a3f8e0e8ccb846913d28da1fe2b69edd
BLAKE2b-256 b02fe2cc4cafd65333fe0e48acc6614c9f654e23eed10e2ed1048b82a5dbc5a9

See more details on using hashes here.

File details

Details for the file libra_ai_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: libra_ai_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for libra_ai_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 848c3e61cc4beae4ec9b360537e75dd72169fe17b050f0a4bc4b1ba8add00a48
MD5 ce3106622a87c00cd7c35796f4c972a6
BLAKE2b-256 94e45bab05c953fa33c53fcebbcad9885de5a2e6da9781b14ec5f0c444ae1ec6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page