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.4.0.tar.gz (50.3 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.4.0-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: astra_plugin_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 50.3 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.4.0.tar.gz
Algorithm Hash digest
SHA256 a0674a6569ef9e082f324bbe805ee0a164793be021be9a50dcd91fd272a20321
MD5 0a308ce829a0d5b7af66391a8fca5fb9
BLAKE2b-256 0549430a257f48a3145e059725d6b2f3720160ae2a3923811306ebd17d97489e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for astra_plugin_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32deadeeda5198c3e99813e5a50555736708e4d87f5014ca411379f91483f87d
MD5 a17439c59f9c2b4073021bb5d7f43bb8
BLAKE2b-256 d7276829313c42c79bef32d0b00669ac61e8188fe79661d42058b2b9a8fa1984

See more details on using hashes here.

Provenance

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