Skip to main content

Official Python SDK for building integrations with Krira Augment RAG pipelines

Project description

Krira Augment SDK

Official Python SDK for building integrations with Krira Augment RAG pipelines.

Installation

pip install krira-augment-sdk

Quick Start

from krira_augment import KriraAugment

# Initialize the client with your API key and pipeline name
client = KriraAugment(api_key="sk-live-your-key", pipeline_name="employees")

# Ask a question to your RAG pipeline
response = client.ask("What can you help me with?")
print(response.answer)

# With conversation context
response = client.ask(
    "Tell me more about that",
    conversation_id="my-session-123"
)
print(response.answer)

API Reference

KriraAugment

The main client class for interacting with Krira Augment pipelines.

Constructor

KriraAugment(
    *,
    api_key: str,           # Your Krira Augment API key
    pipeline_name: str,     # Name or ID of your RAG pipeline
    base_url: str = None,   # Optional custom API base URL
    timeout: float = 15.0,  # Request timeout in seconds
)

Methods

ask(question, *, conversation_id=None, metadata=None, timeout=None)

Send a question to your RAG pipeline and receive an answer.

Parameters:

  • question (str): The question to ask
  • conversation_id (str, optional): Session ID for conversation context
  • metadata (dict, optional): Additional metadata to pass
  • timeout (float, optional): Override the default timeout

Returns: ChatResponse object with:

  • answer (str): The model's response
  • pipeline_name (str): The pipeline used
  • conversation_id (str, optional): The conversation ID
  • raw (dict): Raw API response
close()

Close the underlying HTTP session.

Error Handling

from krira_augment import KriraAugment
from krira_augment.exceptions import (
    AuthenticationError,
    PermissionDeniedError,
    RateLimitError,
    ServerError,
)

client = KriraAugment(api_key="sk-live-your-key", pipeline_name="employees")

try:
    response = client.ask("What is the status of my order?")
    print(response.answer)
except AuthenticationError:
    print("Invalid API key")
except PermissionDeniedError:
    print("API key doesn't have access to this pipeline")
except RateLimitError:
    print("Too many requests, slow down")
except ServerError:
    print("Krira Augment service is temporarily unavailable")

Aliases

For convenience, additional class aliases are available:

from krira_augment import KriraPipeline, KriraAugmentClient

# These are equivalent to KriraAugment
client = KriraPipeline(api_key="...", pipeline_name="...")
client = KriraAugmentClient(api_key="...", pipeline_name="...")

Requirements

  • Python 3.9+
  • requests >= 2.31.0

License

MIT

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

krira_augment_sdk-1.0.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

krira_augment_sdk-1.0.2-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file krira_augment_sdk-1.0.2.tar.gz.

File metadata

  • Download URL: krira_augment_sdk-1.0.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for krira_augment_sdk-1.0.2.tar.gz
Algorithm Hash digest
SHA256 05ec8c15446383dfe7e335daad10ce00b0c4374c58a94fba7aee8f8448d56e55
MD5 21446eb51817acecdb59db0760590c73
BLAKE2b-256 6b4c6ce5522e3c3fd451f65c0eb6cda554377e86b721bc521c29e5d43e8c6c7d

See more details on using hashes here.

File details

Details for the file krira_augment_sdk-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for krira_augment_sdk-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f051c8da00faf35f228bbb97497d03771c7b27d63fbce53d5f7eebf60aa39bd6
MD5 14d85b60459901c8bb3dfdf26c9d2c1c
BLAKE2b-256 79628897dae92fe0b8e5925c45f465bc81f31ed878b1f3419e27997b0b5d1842

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