Skip to main content

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

astra_plugin_sdk-0.1.3.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

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

astra_plugin_sdk-0.1.3-py3-none-any.whl (46.2 kB view details)

Uploaded Python 3

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

Hashes for astra_plugin_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b95c5b3b89bd71c17241f0124c4c5ed8fc3779cfd67ee8a43dcc9cad829e7439
MD5 5d6a304e7af406a844e7e188ac0f14ff
BLAKE2b-256 80947cdda85ba56590cb48949ebfa6edc9cfbdc7bcd6facdc945d3e49a2ef5d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for astra_plugin_sdk-0.1.3.tar.gz:

Publisher: publish-python.yml on mihailinl/AstraPlugins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file astra_plugin_sdk-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for astra_plugin_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1f749880bef5fc59479f6955ec1b1674c16b30c4985f89518b931330db6cef0b
MD5 c640c12e5a4b233d0bc839bddfeb88cc
BLAKE2b-256 7fff28ee5c0bfce4c29f32aad69a9be572592dd848b740f3cb704d8e6df794c8

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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