Skip to main content

A Python client for the NeoAthena API

Project description

NeoAthena Python Client

A Python client library for interacting with the NeoAthena API, providing functionality to create and manage collections, upload files, and perform document retrieval operations.

Installation

pip install neoathena

Quick Start

from neoathena import NeoAthenaClient

# Initialize the client
client = NeoAthenaClient(api_key="your-api-key")

# Check if the collection exists, create it if it doesn't, and upload the file to the collection
results = client.upload_to_collection(
    collection_name="your-collection-name", 
    filepath="path/to/your/file"
)

# Retrieve documents based on a query
results = client.retrieve_from_collection(
    query="your search query", 
    collection_name="your-collection-name", 
    file_names=["file1.txt", "file2.txt"],
    top_k=4
)

# List your collections
result = client.get_collections()

Features

  • Create collection and upload files with automatic content type detection
  • Perform semantic search queries
  • Delete individual documents or entire collections
  • List all user collections
  • Built-in error handling and validation

API Reference

Check out our docs here.

Error Handling

The client includes comprehensive error handling for common scenarios:

  • ValueError: Raised for invalid input parameters
  • FileNotFoundError: Raised when specified files don't exist
  • requests.exceptions.RequestException: Raised for network-related errors

Example error handling:

try:
    response = client.upload_to_collection(api_key, "file.pdf")
except FileNotFoundError:
    print("File not found")
except ValueError as e:
    print(f"Invalid input: {e}")
except requests.exceptions.RequestException as e:
    print(f"API request failed: {e}")

Requirements

  • Python 3.8+
  • requests library
  • Valid API credentials

License

GNU General Public License v3.0

Support

For support, please contact support@raen.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

neoathena-0.0.3.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

neoathena-0.0.3-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file neoathena-0.0.3.tar.gz.

File metadata

  • Download URL: neoathena-0.0.3.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for neoathena-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ff4a2123c795f88d7e6bc5d91fbc7ff8267ef36260ec825bedac8408a2c03ac9
MD5 5880b7ce49faba61170036ef3b382a29
BLAKE2b-256 fd81f92290ec990506a753d7bddccdd718ffdcbeaff7db9211fcbb4b36b50a0f

See more details on using hashes here.

File details

Details for the file neoathena-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: neoathena-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for neoathena-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 526b2184e3051814b1a673fb694a3ee24d9dc08d4a7c25918b32cebe48f5715d
MD5 b4a520787223805ae91ee08519e2425f
BLAKE2b-256 dd7ae4e50f9b59d133f7df76fb357de3481661c8373c35abaefdc357c83e23d0

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