Skip to main content

Seltz Python SDK for AI-powered search

Project description

Seltz Python SDK

The official Python SDK for the Seltz AI-powered search API.

Installation

pip install seltz

Quick Start

from seltz import Seltz

# Initialize with API key
client = Seltz.create(api_key="your-api-key")

# Perform a search
response = client.search("your search query")

# Access results
for document in response.documents:
    print(f"URL: {document.url}")
    print(f"Content: {document.content}")

API Key

Set your API key using one of these methods:

  1. Environment variable (recommended):

    export SELTZ_API_KEY="your-api-key"
    
  2. Direct parameter:

    client = Seltz.create(api_key="your-api-key")
    

API Reference

Seltz.create(api_key=None, endpoint="api.seltz.ai", insecure=False)

Creates a new Seltz client instance.

Parameters:

  • api_key (str, optional): API key for authentication. Defaults to SELTZ_API_KEY environment variable.
  • endpoint (str): API endpoint. Defaults to "api.seltz.ai".
  • insecure (bool): Use insecure connection. Defaults to False.

Returns: Seltz instance

client.search(text, max_documents=10)

Performs a search query.

Parameters:

  • text (str): The search query text.
  • max_documents (int): Maximum number of documents to return. Defaults to 10.

Returns: SearchResponse with a documents field containing search results.

Error Handling

from seltz import (
    Seltz,
    SeltzConfigurationError,
    SeltzAuthenticationError,
    SeltzConnectionError,
    SeltzAPIError,
    SeltzTimeoutError,
    SeltzRateLimitError,
)

try:
    client = Seltz.create(api_key="your-api-key")
    response = client.search("query")
except SeltzConfigurationError as e:
    print(f"Configuration error: {e}")
except SeltzAuthenticationError as e:
    print(f"Authentication error: {e}")
except SeltzConnectionError as e:
    print(f"Connection error: {e}")
except SeltzTimeoutError as e:
    print(f"Timeout error: {e}")
except SeltzRateLimitError as e:
    print(f"Rate limit error: {e}")
except SeltzAPIError as e:
    print(f"API error: {e}")

Requirements

  • Python 3.8+
  • grpcio >= 1.76.0
  • protobuf >= 6.33.1

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

seltz-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

seltz-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file seltz-0.1.0.tar.gz.

File metadata

  • Download URL: seltz-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.1

File hashes

Hashes for seltz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4918bda0debd7ae6459d05b27356a423ab8d3c5ba1b4d53d01807353951b042a
MD5 f42c188f1506204de9367986f4ea8be2
BLAKE2b-256 8dc3384e580eb74680f815e30206a3e0b9131527de4a75969e5f5e2b0c61da76

See more details on using hashes here.

File details

Details for the file seltz-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: seltz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.1

File hashes

Hashes for seltz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f0a0983f93e517c763d6c70e0e39e850300fef35f2b74885b05694a65a9b521
MD5 5af6e6156b91ee3e6a4bd0131e582553
BLAKE2b-256 e1d1845a381b9ac7bc1e5ac8d881fea527708ad1514e77f22593f5e88f8bf8b4

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