Python SDK for building Astra plugins
Project description
Astra Plugin SDK (Python)
Build plugins for Astra in Python.
Installation
pip install astra-plugin-sdk
Quick Start
from astra_plugin_sdk import Plugin
class MyPlugin(Plugin):
async def list_tools(self):
return [{
"name": "hello",
"description": "Say hello",
"parameters_json": '{"type": "object", "properties": {}}',
}]
async def call_tool(self, name, arguments_json):
if name == "hello":
return {"success": True, "result": "Hello from the plugin!"}
return {"success": False, "error": f"Unknown tool: {name}"}
if __name__ == "__main__":
MyPlugin().run()
Capabilities
Override the methods you need:
- Tools:
list_tools(),call_tool(name, args) - TTS:
tts_list_voices(),tts_synthesize(text, voice_id, speed, pitch) - STT:
stt_get_languages() - AI Provider:
ai_get_models() - Actions:
get_action_types(),execute_action(type, params) - Triggers:
get_trigger_types() - Lifecycle:
on_config_changed(config),on_shutdown(),health_check()
Host Client
Access daemon services from your plugin:
class MyPlugin(Plugin):
async def on_config_changed(self, config):
# Log to daemon
await self.host.log("info", f"Config updated: {config}")
# Fire a trigger
await self.host.fire_trigger("my_trigger", '{"key": "value"}')
# Get daemon info
info = await self.host.get_daemon_info()
print(f"Daemon version: {info.version}")
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
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 astra_plugin_sdk-0.1.3.tar.gz.
File metadata
- Download URL: astra_plugin_sdk-0.1.3.tar.gz
- Upload date:
- Size: 44.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b95c5b3b89bd71c17241f0124c4c5ed8fc3779cfd67ee8a43dcc9cad829e7439
|
|
| MD5 |
5d6a304e7af406a844e7e188ac0f14ff
|
|
| BLAKE2b-256 |
80947cdda85ba56590cb48949ebfa6edc9cfbdc7bcd6facdc945d3e49a2ef5d7
|
Provenance
The following attestation bundles were made for astra_plugin_sdk-0.1.3.tar.gz:
Publisher:
publish-python.yml on mihailinl/AstraPlugins
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
astra_plugin_sdk-0.1.3.tar.gz -
Subject digest:
b95c5b3b89bd71c17241f0124c4c5ed8fc3779cfd67ee8a43dcc9cad829e7439 - Sigstore transparency entry: 1283094525
- Sigstore integration time:
-
Permalink:
mihailinl/AstraPlugins@4babb0d4f2bf03bed36f44abbd3e6a80810b366b -
Branch / Tag:
refs/tags/python-v0.1.3 - Owner: https://github.com/mihailinl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@4babb0d4f2bf03bed36f44abbd3e6a80810b366b -
Trigger Event:
push
-
Statement type:
File details
Details for the file astra_plugin_sdk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: astra_plugin_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 46.2 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 |
1f749880bef5fc59479f6955ec1b1674c16b30c4985f89518b931330db6cef0b
|
|
| MD5 |
c640c12e5a4b233d0bc839bddfeb88cc
|
|
| BLAKE2b-256 |
7fff28ee5c0bfce4c29f32aad69a9be572592dd848b740f3cb704d8e6df794c8
|
Provenance
The following attestation bundles were made for astra_plugin_sdk-0.1.3-py3-none-any.whl:
Publisher:
publish-python.yml on mihailinl/AstraPlugins
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
astra_plugin_sdk-0.1.3-py3-none-any.whl -
Subject digest:
1f749880bef5fc59479f6955ec1b1674c16b30c4985f89518b931330db6cef0b - Sigstore transparency entry: 1283094564
- Sigstore integration time:
-
Permalink:
mihailinl/AstraPlugins@4babb0d4f2bf03bed36f44abbd3e6a80810b366b -
Branch / Tag:
refs/tags/python-v0.1.3 - Owner: https://github.com/mihailinl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@4babb0d4f2bf03bed36f44abbd3e6a80810b366b -
Trigger Event:
push
-
Statement type: