Skip to main content

Managed email identities for AI agents — the Python client for Sente (import sente).

Project description

sente-sdk

Managed email identities for AI agents — the Python client for Sente. Give your agent a real, reusable email address it owns: send, receive, and react to mail.

Dependency-free (stdlib only). The PyPI distribution is sente-sdk; the import is sente.

pip install sente-sdk
from sente import Sente

sente = Sente(api_key="sk_sente_...")              # get a key with the `sente` CLI: `sente login`

idt = sente.identities.create(name="support-bot")  # -> support-bot@agents.sente.run
sente.messages.send(idt.id, to="user@example.com", subject="hi", text="from your agent")

# React to inbound mail (a long-running consumer; for production prefer a webhook):
for msg in sente.messages.stream(idt.id):
    if msg.direction != "outbound":
        body = (msg.parsed or {}).get("text", "")
        # ... handle msg.from_addr / msg.subject / body

Waiting for a verification email (the agent signed up somewhere with idt.email)? Stamp since before triggering the action, then block for the extracted code or link:

from datetime import datetime, timezone

since = datetime.now(timezone.utc).isoformat()
# ... trigger the app's "send code" action ...
r = sente.messages.wait_for_otp(idt.id, since=since, timeout=60)  # -> OtpResult(code, message) | None
if r:
    print(r.code)  # magic links: wait_for_magic_link(...) -> MagicLinkResult(link, message) | None

Webhook handlers receive a thin event { "type": "message.received", "message": { "id": ... } } with an x-sente-secret header; fetch the full message with sente.messages.get(message_id).

Full onboarding playbook (CLI + framework templates): https://sente.run/skill.md.

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

sente_sdk-0.5.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

sente_sdk-0.5.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file sente_sdk-0.5.0.tar.gz.

File metadata

  • Download URL: sente_sdk-0.5.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sente_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 74e2f6cd2053870f20679ef3589e9791e567b351702475b135d1701998520d07
MD5 078b9c3b05ba88db9d24effc6b7c234d
BLAKE2b-256 15301cdaf0086bd97d800321411478ea9270192f366a63eecde1ad2d0e8517c0

See more details on using hashes here.

File details

Details for the file sente_sdk-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: sente_sdk-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sente_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd48bd8c3aabff9fe7e5b6c8a3ac6b1588ae05c0739871837d694b3c90086fa9
MD5 955d28f3e23d987744c308518ce73f21
BLAKE2b-256 d59961769001a3bc3101d2d9c44c83dac2795802f87d339b935b8c8df1a4a7b1

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