Seltz Python SDK for AI-powered search
Project description
Seltz Python SDK
Official Python SDK for Seltz, the Web search engine for AI agents.
💾 Installation
pip install seltz
Requires Python 3.9 or higher.
⚡️ Quick Start
from seltz import Seltz
client = Seltz(api_key="your-api-key")
# Search the Web
response = client.search("best ai search engines", max_results=10)
# Access results
for document in response.documents:
print(f"URL: {document.url}")
print(f"Content: {document.content}")
Output:
URL: https://www.best-ai-search-engines.com
Content: Generative AI can make finding information faster and more intuitive.
If you’re tired of traditional search, explore some of the best AI-powered
search engines we've tested...
Answer
Get a natural-language answer grounded in Web search results, with citations:
from seltz import Seltz
client = Seltz(api_key="your-api-key")
response = client.answer("Who is Apple's next CEO?")
print(response.answer)
for citation in response.citations:
print(f"Source: {citation.url}")
Answer (streaming)
Stream an answer as it is generated, instead of waiting for the full response. answer_stream yields events as they arrive: a citations event first, then text_delta chunks, then a terminal finish_reason. Inspect each event with event.WhichOneof("event"):
from seltz import Seltz
client = Seltz(api_key="your-api-key")
for event in client.answer_stream("Who is Apple's next CEO?"):
kind = event.WhichOneof("event")
if kind == "citations":
for citation in event.citations.citations:
print(f"Source: {citation.url}")
elif kind == "text_delta":
print(event.text_delta, end="", flush=True)
elif kind == "finish_reason":
print()
Streaming is also available asynchronously via AsyncSeltz — async for over the events:
import asyncio
from seltz import AsyncSeltz
async def main():
async with AsyncSeltz(api_key="your-api-key") as client:
async for event in client.answer_stream("Who is Apple's next CEO?"):
kind = event.WhichOneof("event")
if kind == "citations":
for citation in event.citations.citations:
print(f"Source: {citation.url}")
elif kind == "text_delta":
print(event.text_delta, end="", flush=True)
elif kind == "finish_reason":
print()
asyncio.run(main())
Async
The same API is available asynchronously via AsyncSeltz — await each call:
import asyncio
from seltz import AsyncSeltz
async def main():
client = AsyncSeltz(api_key="your-api-key")
response = await client.search("best ai search engines", max_results=10)
for document in response.documents:
print(f"URL: {document.url}")
print(f"Content: {document.content}")
asyncio.run(main())
To close the connection deterministically rather than leaving it to garbage collection, use AsyncSeltz as an async context manager (async with) or call await client.close() when done.
📚 Documentation
Browse the documentation for more details.
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-1.5.0.tar.gz.
File metadata
- Download URL: seltz-1.5.0.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9078a849cea495b56c135be41a342798faab6fd4ac609f98a07677b13200ad7d
|
|
| MD5 |
56600c131039e8b12ca00dfb2e87b7ee
|
|
| BLAKE2b-256 |
4f9dbba70fefb317d1fe7f1042da1e617d1ccd7e96118d34baa774d7c4e80d20
|
Provenance
The following attestation bundles were made for seltz-1.5.0.tar.gz:
Publisher:
python-publish.yml on seltz-ai/seltz-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seltz-1.5.0.tar.gz -
Subject digest:
9078a849cea495b56c135be41a342798faab6fd4ac609f98a07677b13200ad7d - Sigstore transparency entry: 1935577028
- Sigstore integration time:
-
Permalink:
seltz-ai/seltz-python-sdk@65ebbb74534bcc4828d473057e6bda591d082b37 -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/seltz-ai
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@65ebbb74534bcc4828d473057e6bda591d082b37 -
Trigger Event:
release
-
Statement type:
File details
Details for the file seltz-1.5.0-py3-none-any.whl.
File metadata
- Download URL: seltz-1.5.0-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df839da5cade3357da896416e42a4d2fbee440aaa8edcb241d76d50ff6b3ac31
|
|
| MD5 |
4abd0fa13f5c631d41d8cc042a5b250f
|
|
| BLAKE2b-256 |
68399878bc5c46bcc734aa8f2191642ca1725b6918b17f1bc43cc20a0b1d37b5
|
Provenance
The following attestation bundles were made for seltz-1.5.0-py3-none-any.whl:
Publisher:
python-publish.yml on seltz-ai/seltz-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seltz-1.5.0-py3-none-any.whl -
Subject digest:
df839da5cade3357da896416e42a4d2fbee440aaa8edcb241d76d50ff6b3ac31 - Sigstore transparency entry: 1935577083
- Sigstore integration time:
-
Permalink:
seltz-ai/seltz-python-sdk@65ebbb74534bcc4828d473057e6bda591d082b37 -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/seltz-ai
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@65ebbb74534bcc4828d473057e6bda591d082b37 -
Trigger Event:
release
-
Statement type: