Skip to main content

SHADAI Client

Project description

SHADAI Intelligence Client

A Python client for interacting with the SHADAI Intelligence API. This client provides a simple interface for document processing, querying, and session management.

Installation

pip install shadai

Requirements

  • Python >= 3.12
  • Environment Variables:
    • INTELLIGENCE_API_KEY: Your SHADAI Intelligence API key

Quick Start

import asyncio
from shadai.intelligence.core.session import Session

async def main():
    async with Session(type="standard", delete_session=True) as session:
        await session.ingest(input_dir=input_dir)

        await session.query(
            query="¿De qué habla la quinta enmienda?", display_in_console=True
        )

        await session.get_summary(
            display_in_console=True
        )

        await session.create_article(
            topic="Enmiendas de los estados unidos y su impacto en la sociedad",
            display_in_console=True,
        )

if __name__ == "__main__":
    asyncio.run(main())

Features

  • Asynchronous API interactions
  • Automatic session management
  • File ingestion with progress tracking
  • Interactive query interface
  • Robust error handling and retries
  • Rich console output

Session Configuration

Parameter Type Description Default
type str Processing type ("light", "standard", "deep") "standard"
llm_model str Language model to use None
llm_temperature float Model temperature None
llm_max_tokens int Maximum tokens for response None
query_mode str Query processing mode None
language str Response language None
delete_session bool Auto-delete session on exit True

Error Handling

The client includes comprehensive error handling for:

  • Configuration errors
  • API communication issues
  • File processing problems
  • Session management failures

Author

SHADAI GROUP jaisir@shadai.ai

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

shadai-0.1.7.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

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

shadai-0.1.7-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file shadai-0.1.7.tar.gz.

File metadata

  • Download URL: shadai-0.1.7.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for shadai-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a1293df7cc15713a78dab634b8fcd5a94bc5a5742122653d77879af31ff0371a
MD5 1e05de58bb0dae8eb769315e51f7a074
BLAKE2b-256 09bfa9a6716568dcbc4ed4862e0ce5d6735841f939670fdc269ff443558f6963

See more details on using hashes here.

File details

Details for the file shadai-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: shadai-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for shadai-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a0de98aac49cc21debabc82b523a3ee6f37e1946a3bc13faa514c5542cf7a315
MD5 4bc6f8959f72f6ed47624b6e1d159c91
BLAKE2b-256 f10e36b74f9f842383b89f00b76d3103d37bb49e69fbc828fbbc2223de17aa5b

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