Skip to main content

Thin client for interacting with NineBit CIQ backend

Project description

🧠 NineBit CIQ Python SDK

Version License build Code style: black Linting: flake8 pre-commit

Official Python client for interacting with NineBit CIQ, a Retrieval-Augmented Generation (RAG) workflow orchestration platform for rapid prototyping of AI/ML ideas using enterprise data and open-source models.


🚀 Features

  • Retrieval-Augmented Generation (RAG) Perform semantic search and intelligent query answering using hybrid retrieval techniques.
  • Flexible Query Interface Send queries with configurable similarity thresholds and top_k result tuning.
  • Callback Support for Asynchronous Workflows Pass in callbacks to handle results or errors once workflows complete — ideal for event-driven applications.
  • Workflow Polling with Timeout Control Monitor long-running workflows with built-in polling, status checking, and customizable timeouts.
  • Simple, Extensible API Clean, Pythonic interfaces with support for both synchronous returns and optional callbacks.
  • Error-Handled Execution Flow Graceful handling of task failures, timeouts, and unexpected states with descriptive exceptions.
  • Logging Support Integrated logging for easy debugging and transparency during polling or querying.

📦 Installation

pip install ninebit-ciq

Or clone and install locally:

git clone https://github.com/NineBit-Computing/ciq-py-client.git
cd ciq-py-client
pip install .

🧪 Quickstart (Python)

from ninebit_ciq import NineBitCIQClient

client = NineBitCIQClient(
    api_key="YOUR_API_KEY"
)

def on_done(error, data):
    if error:
        print(f"Ingest_file failed: {error}")
    else:
        print(f"Ingest_file succeeded: {str(data)}")

# 1. Ingest file as datasource for performing RAG
client.ingest_file(file="files/my_file.pdf", callback=on_done)

# 2. Ask your query
query = "What are land breeze?"
response = client.rag_query(query=query)
print(f"Query response is {response}")

🔐 Authentication

Pass your API Key using the X-API-Key header:

Python SDK: NineBitCIQClient(api_key)

📚 SDK Reference

Method Description
ingest_file() Reads and uploads a PDF or DOCX file to the backend for processing.
rag_query() Performs a Retrieval-Augmented Generation (RAG) query using the provided input.

🛠️ Logging

You can control logging verbosity:

from ninebit_ciq import NineBitCIQClient
import logging

client = NineBitCIQClient(api_key, log_level=logging.INFO)

📁 Project Structure

ciq-py-client/
├── src/ninebit_ciq/
│ ├── client.py # Core SDK logic
│ ├── logger.py # Logger setup
│ ├── cli.py # CLI interface
│ └── **init**.py # Version info
├── examples/usage.py
├── examples/usage_with_thread.py
├── README.md
├── setup.py
└── version.txt

📄 License

MIT License © NineBit Computing

✉️ Contact

Questions? Reach out via ninebit.in or raise an issue in the GitHub repo.

Contributing

While we value open-source contributions to this SDK, the code is generated programmatically. Additions made directly would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

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

ninebit_ciq-1.0.6.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

ninebit_ciq-1.0.6-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file ninebit_ciq-1.0.6.tar.gz.

File metadata

  • Download URL: ninebit_ciq-1.0.6.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ninebit_ciq-1.0.6.tar.gz
Algorithm Hash digest
SHA256 d664b9b8dbe04e602519140d9414d50d533ecf0cbad223938073d4e0c54227f1
MD5 967707bc6eee3b29fdf74db7e42000a4
BLAKE2b-256 3ed8576e8f5e7096e76501fb889b135eae5fed0f14a12f302dcabe87f053abb7

See more details on using hashes here.

File details

Details for the file ninebit_ciq-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: ninebit_ciq-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ninebit_ciq-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5d7e8f97c5ce369c5e80f7797f3cfc019cbc692b5a076dfdca17798325b7f5b7
MD5 4baea05fc6ed6b1af5a10c0e8a443307
BLAKE2b-256 65c0dd38e3ca29d956cd2268d5d6b370b6311cd47538be2c8e47a186590ead09

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