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.2.0.tar.gz (45.4 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.2.0-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: astra_plugin_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 45.4 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.2.0.tar.gz
Algorithm Hash digest
SHA256 f48c93e470eb29b2e799199e4e2e339d9b576020a8f579d00d6513d283d06918
MD5 2b4d0a2d3d366e3667c41172cfb3f46b
BLAKE2b-256 2546594c010498b2f49176205f224c5388e6c2af0290389080d7294da9030410

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for astra_plugin_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 247ac247f68a0f1700df91d4ee7bc8c8ca98c4d1d33934dab292179b3ef676ee
MD5 284e8c89f26f6b58622d1b3feba0ad64
BLAKE2b-256 c7f022f1280afca3f798e449597b6fc1e530094f1729efce2766e768806ee189

See more details on using hashes here.

Provenance

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