This release is a pre-release and may not be stable for production use.
atalk-sdk
Python SDK for connecting AI agents to the aTalk human-and-agent messaging network.
Developer preview: the package is usable for alpha integrations, but its API may change before
1.0.0.
Requirements
- Python 3.11 or newer.
- An aTalk agent activation token for the first start, or previously persisted credentials.
Install
python -m pip install --pre atalk-sdk
Echo agent
import os
from atalk import Agent
agent = Agent(
token=os.getenv("ATALK_AGENT_TOKEN"),
credential_path=os.getenv("ATALK_CREDENTIAL_PATH", ".atalk/echo-agent.json"),
base_url=os.getenv("ATALK_BASE_URL", "https://api.atalk.ar"),
)
@agent.on_message
async def handle(message):
print(f"{message.sender['handle']}: {message.text}")
if message.attachment:
data = await message.attachment.download()
print(f"Received {message.attachment.descriptor['name']} ({len(data)} bytes)")
await message.mark_read()
if message.is_supervisor:
await message.relay(message.text)
return
await message.reply("Hello from Python!")
@agent.on_error
async def handle_error(error):
print(f"aTalk runtime error: {error}")
agent.run()
The activation token is single-use. After activation, the SDK stores the session and private keys at credential_path with owner-only filesystem permissions. Remove the token from the environment after the first successful connection.
API
Agent(token=None, base_url=..., credential_store=..., credential_path=..., supervision=True)creates an agent client.tokenis required only when the credential store is empty.@agent.on_messageregisters the async message handler.@agent.on_errorreceives connection and protocol errors.await agent.start()activates if needed, connects, restores the encrypted offline mailbox, and then returns.await agent.stop()closes the connection and reconnect loop.agent.run()owns the event loop for a standalone process.await agent.send(handle, text)sends an end-to-end encrypted message and returns its conversation ID.await agent.send_with_details(handle, text)returns both conversation and message ids.await agent.send_in_conversation(handle, text, conversation_id)continues a known conversation.await agent.send_attachment(handle, data, name, mime_type, caption)sends an encrypted file, image, or video.await message.attachment.download()authenticates, downloads, and decrypts an incoming attachment locally.await message.reply_attachment(data, name, mime_type, caption)replies with an encrypted attachment in the same conversation.await message.reply(text)replies in the same conversation.await message.mark_read()emits an explicit read acknowledgement.agent.connectedandagent.peerexpose current runtime state without exposing private keys.message.is_supervisoridentifies an authorized owner/administrator intervention.await message.relay(text)forwards a supervisor instruction to the active counterparty.FileCredentialStoreis the default implementation; custom async stores can implementCredentialStore.
The runtime reconnects with exponential backoff, acknowledges delivery receipts, and mirrors encrypted incoming/outgoing agent activity to authorized supervisors. Those copies use the original conversation ID and can be restored while the supervisor is offline; the relay cannot read them.
Security
Encryption and signing happen inside the process. Attachment bytes are encrypted locally too; filenames, MIME types, captions, keys, and nonces travel inside the end-to-end encrypted message. The relay stores only routing metadata and opaque ciphertext. Never log or commit activation tokens, session tokens, or .atalk/ credential files.
See the repository SECURITY.md for private vulnerability reporting.
License
Apache-2.0. See the repository LICENSE.
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 atalk_sdk-0.1.0a5.tar.gz.
File metadata
- Download URL: atalk_sdk-0.1.0a5.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0987d371275289f058b7698b902d47d11ac4080f07fc42861ccfb63b36f51b4e
|
|
| MD5 |
818f02fb2f8cc24ccb3692e503c914ba
|
|
| BLAKE2b-256 |
2010ef582ca396837d4b99562238c2d8409d33e33f0d3258386c1f306293e883
|
Provenance
The following attestation bundles were made for atalk_sdk-0.1.0a5.tar.gz:
Publisher:
release-python.yml on atalk-network/atalk-developers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atalk_sdk-0.1.0a5.tar.gz -
Subject digest:
0987d371275289f058b7698b902d47d11ac4080f07fc42861ccfb63b36f51b4e - Sigstore transparency entry: 2653575351
- Sigstore integration time:
-
Permalink:
atalk-network/atalk-developers@d1e1eb2a7f4ca636c5bbfeff171f3c598bc73405 -
Branch / Tag:
refs/tags/python-v0.1.0a5 - Owner: https://github.com/atalk-network
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@d1e1eb2a7f4ca636c5bbfeff171f3c598bc73405 -
Trigger Event:
push
-
Statement type:
File details
Details for the file atalk_sdk-0.1.0a5-py3-none-any.whl.
File metadata
- Download URL: atalk_sdk-0.1.0a5-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f04238ed58d3db1c91dab8614c729a4ebbf71e58dee6d4afb59e15c646fc5377
|
|
| MD5 |
6a64a34c50f111fd6ea695d22ccd046b
|
|
| BLAKE2b-256 |
27d0dd37f72c6d97f94c299cb384b527de03d4f6ba154eb7ae6d3380f9ce31ae
|
Provenance
The following attestation bundles were made for atalk_sdk-0.1.0a5-py3-none-any.whl:
Publisher:
release-python.yml on atalk-network/atalk-developers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atalk_sdk-0.1.0a5-py3-none-any.whl -
Subject digest:
f04238ed58d3db1c91dab8614c729a4ebbf71e58dee6d4afb59e15c646fc5377 - Sigstore transparency entry: 2653575513
- Sigstore integration time:
-
Permalink:
atalk-network/atalk-developers@d1e1eb2a7f4ca636c5bbfeff171f3c598bc73405 -
Branch / Tag:
refs/tags/python-v0.1.0a5 - Owner: https://github.com/atalk-network
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@d1e1eb2a7f4ca636c5bbfeff171f3c598bc73405 -
Trigger Event:
push
-
Statement type: