Plugin Structure

Plugins in Project Pleiades are like stars in our constellation, each serving a unique purpose. The structure is designed to be flexible and extensible, allowing developers to create powerful, domain-specific functionalities.1. Plugins: Extend BasePlugin to define the core logic and properties of your plugin. This is the foundational class that integrates various tools and utilities to perform specific tasks.

  • Tools: Extend BaseTool to create specific functionalities within a plugin. Tools act as the operational components that process inputs and generate outputs. They are designed to be reusable and can be combined to form complex workflows.

  • Utilities: Extend BaseUtility to implement the core business logic. Utilities provide the underlying functionality that tools rely on, such as making API calls or processing data. They abstract away complex operations, making it easier to develop and maintain plugins.

Example Code

Here's a basic example of how to create a plugin with tools and utilities:

from pleiades_core.plugins import BasePlugin
from pleiades_core.plugins.tools import BaseTool
from pleiades_core.plugins.utilities import BaseUtility

class StarGreeterUtility(BaseUtility):
    async def arun(self, *args, **kwargs) -> str:
        return "Greetings from the stars!"

class GreeterTool(BaseTool):
    name = "star-greeter"
    description = "Use this tool for celestial greetings."
    utility = StarGreeterUtility()

class CelestialPlugin(BasePlugin):
    name = "Celestial"
    description = "A plugin for celestial interactions."
    tools = [GreeterTool()]

celestial_plugin = CelestialPlugin()

Specialized Utilities

Project Pleiades provides several specialized utility classes to simplify common tasks:

  • RemoteUtility: For making remote API calls, handling requests and responses automatically.

  • BlockchainUtility: For complex blockchain operations, such as generating transactions and waiting for completion.

  • LLMUtility: For interactions with language models, defining task descriptions and output structures.

Developing Plugins

To develop a new plugin:1. Create a new directory in libs/community/plugins/ for your plugin.

  • Extend the appropriate base classes (BasePlugin, BaseTool, BaseUtility).

  • Implement the required methods and properties.

  • Use specialized utilities where appropriate to simplify development.

For more detailed examples, refer to the existing plugins in the libs/community/plugins/ directory.

class CosmicFarewellUtility(BaseUtility):
    async def arun(self, *args, **kwargs) -> str:
        return "Until we meet again in the cosmos!"
    
class GreeterToolInput(BaseToolInput):
    pass
# Plugins System

Plugins in PleiadesAI are powerful, domain-specific modules that extend the core functionality of the AI assistant. They are designed to handle particular tasks of domain, leveraging a combination of Tools and Utilities to process user requests and provide specialized responses.

## Plugin Structure

A plugin is essentially an LLM (Large Language Model) Agent that performs specific tasks using a set of Tools. The structure of a plugin is hierarchical:

1. **Plugin**: Extends `BasePlugin`
2. **Tools**: Extend `BaseTool`
3. **Utilities**: Extend `BaseUtility`

Last updated