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:
-
Environment variable (recommended):
export SELTZ_API_KEY="your-api-key"
-
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 toSELTZ_API_KEYenvironment 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file seltz-0.1.1.tar.gz.
File metadata
- Download URL: seltz-0.1.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79b497229d6b848d08681a22a738763cb7551c9fc6b7a7d39c4bcebf40b92eef
|
|
| MD5 |
505c5df68d94f4201393af1595e988f9
|
|
| BLAKE2b-256 |
af519820ecb20c6d907384fd53951c555025154c36e36a2bd2f99dc86126ec8a
|
File details
Details for the file seltz-0.1.1-py3-none-any.whl.
File metadata
- Download URL: seltz-0.1.1-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.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d5db38994f355106325fc19bd3811b9592e79121c179c63e11551aa971c0af8
|
|
| MD5 |
de4b9d4cf8179481f100fa0f8e49868d
|
|
| BLAKE2b-256 |
42ab9124b2a2e3f5b965c104e87931dde27590fc5454f0058e585a65c6d2a7b2
|