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.4.tar.gz (45.1 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.4-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file astra_plugin_sdk-0.1.4.tar.gz.

File metadata

  • Download URL: astra_plugin_sdk-0.1.4.tar.gz
  • Upload date:
  • Size: 45.1 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.4.tar.gz
Algorithm Hash digest
SHA256 efee9aee3cf9aec6baaa66376839def929d98446c95acbb4f6e155a776bccf82
MD5 a0caf8b3f9dff485c6ef0339d7fd09f3
BLAKE2b-256 b20e9e3509879ba7d02f4ff7eb272a877b59e71badf84beaea2b4a8ea809b1a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for astra_plugin_sdk-0.1.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for astra_plugin_sdk-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 958231d600ed9136dee069ea47426f760fe62a82ced59b9b4e68231440361a3c
MD5 4c897a92d16d3c380260a05e98e41f54
BLAKE2b-256 eb19730d5ece590303a8f6ca3d3188e212415b60a720470655da839574254ff2

See more details on using hashes here.

Provenance

The following attestation bundles were made for astra_plugin_sdk-0.1.4-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