Skip to main content

Typed interfaces for building NeuralCleave plugins, tools, and channel adapters — no gateway dependencies required.

Project description

neuralcleave-sdk

Typed interfaces for building NeuralCleave plugins — without installing the full gateway.

NeuralCleave's gateway depends on FastAPI, Redis, Qdrant, and SDKs for all 14 supported channels. None of that is needed to write a plugin — only to run the gateway that loads it. This package contains just the three base classes a plugin author needs, with zero third-party dependencies.

Install

pip install neuralcleave-sdk

Writing a plugin

Every plugin package registers a Plugin subclass via a NeuralCleave.plugins entry point:

# my_plugin/plugin.py
from neuralcleave_sdk import Plugin, PluginMetadata, Tool, ToolResult


class WeatherTool(Tool):
    name = "get_weather"
    description = "Get the current weather for a city."
    parameters = {
        "city": {"type": "str", "description": "City name", "required": True},
    }
    permissions = ["network"]

    async def execute(self, city: str) -> ToolResult:
        # ... call a weather API ...
        return ToolResult(tool=self.name, output=f"Sunny in {city}")


class WeatherPlugin(Plugin):
    metadata = PluginMetadata(
        name="NeuralCleave-weather",
        version="1.0.0",
        plugin_type="tool",
        description="Adds a get_weather tool.",
        permissions=["network"],
    )

    def get_tools(self):
        return [WeatherTool()]
# my_plugin/pyproject.toml
[project.entry-points."NeuralCleave.plugins"]
NeuralCleave-weather = "my_plugin.plugin:WeatherPlugin"

Once published to PyPI and installed alongside the NeuralCleave gateway, neuralcleave hub install neuralcleave-weather discovers and loads it.

Plugin types

plugin_type Implement Contributes
tool get_tools() One or more Tool instances
channel get_channel_adapter() A ChannelAdapter instance
tts / stt / memory Loaded by name; see gateway docs
generic on_load() / on_unload() Lifecycle hooks only

Writing a channel adapter plugin

from neuralcleave_sdk import ChannelAdapter, InboundMessage


class MyChannelAdapter(ChannelAdapter):
    channel_id = "my_channel"

    async def connect(self) -> None: ...
    async def disconnect(self) -> None: ...
    async def send(self, target, text, *, reply_to=None, attachments=None):
        ...

    async def _on_platform_event(self, raw_event: dict) -> None:
        await self._dispatch(InboundMessage(
            channel=self.channel_id,
            sender_id=raw_event["user_id"],
            sender_name=raw_event["user_name"],
            text=raw_event["text"],
        ))

License

MIT

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

neuralcleave_sdk-0.1.3.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

neuralcleave_sdk-0.1.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file neuralcleave_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: neuralcleave_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for neuralcleave_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ea4d42931e17caeca8ac957c51d8b7092329299d5af702a41674c1ac852a3a3f
MD5 36b223b15dd0af0fb1e2d2153c45befc
BLAKE2b-256 127235fd1c8fd66122efa3db570fa6da13663c079d7ec53989870f494b25b8e8

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on TheAmitChandra/NeuralCleave

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

File details

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

File metadata

File hashes

Hashes for neuralcleave_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e9ca669ae8b404aee2f683916fac0bb068ae764c44a77432f5bf229b8948638
MD5 52b4cae576019fe3217e520ac07809e0
BLAKE2b-256 4add3a203da043cd89a103c81bd319d0383411ddeb91eb7592f8ff86deb7e135

See more details on using hashes here.

Provenance

The following attestation bundles were made for neuralcleave_sdk-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on TheAmitChandra/NeuralCleave

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