semantic markup update
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Dict, Any
|
||||
from .logger import belief_scope
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
@@ -17,43 +18,86 @@ class PluginBase(ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
# [DEF:id:Function]
|
||||
# @PURPOSE: Returns the unique identifier for the plugin.
|
||||
# @PRE: Plugin instance exists.
|
||||
# @POST: Returns string ID.
|
||||
# @RETURN: str - Plugin ID.
|
||||
def id(self) -> str:
|
||||
"""A unique identifier for the plugin."""
|
||||
pass
|
||||
with belief_scope("id"):
|
||||
pass
|
||||
# [/DEF:id:Function]
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
# [DEF:name:Function]
|
||||
# @PURPOSE: Returns the human-readable name of the plugin.
|
||||
# @PRE: Plugin instance exists.
|
||||
# @POST: Returns string name.
|
||||
# @RETURN: str - Plugin name.
|
||||
def name(self) -> str:
|
||||
"""A human-readable name for the plugin."""
|
||||
pass
|
||||
with belief_scope("name"):
|
||||
pass
|
||||
# [/DEF:name:Function]
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
# [DEF:description:Function]
|
||||
# @PURPOSE: Returns a brief description of the plugin.
|
||||
# @PRE: Plugin instance exists.
|
||||
# @POST: Returns string description.
|
||||
# @RETURN: str - Plugin description.
|
||||
def description(self) -> str:
|
||||
"""A brief description of what the plugin does."""
|
||||
pass
|
||||
with belief_scope("description"):
|
||||
pass
|
||||
# [/DEF:description:Function]
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
# [DEF:version:Function]
|
||||
# @PURPOSE: Returns the version of the plugin.
|
||||
# @PRE: Plugin instance exists.
|
||||
# @POST: Returns string version.
|
||||
# @RETURN: str - Plugin version.
|
||||
def version(self) -> str:
|
||||
"""The version of the plugin."""
|
||||
pass
|
||||
with belief_scope("version"):
|
||||
pass
|
||||
# [/DEF:version:Function]
|
||||
|
||||
@abstractmethod
|
||||
# [DEF:get_schema:Function]
|
||||
# @PURPOSE: Returns the JSON schema for the plugin's input parameters.
|
||||
# @PRE: Plugin instance exists.
|
||||
# @POST: Returns dict schema.
|
||||
# @RETURN: Dict[str, Any] - JSON schema.
|
||||
def get_schema(self) -> Dict[str, Any]:
|
||||
"""
|
||||
Returns the JSON schema for the plugin's input parameters.
|
||||
This schema will be used to generate the frontend form.
|
||||
"""
|
||||
pass
|
||||
with belief_scope("get_schema"):
|
||||
pass
|
||||
# [/DEF:get_schema:Function]
|
||||
|
||||
@abstractmethod
|
||||
# [DEF:execute:Function]
|
||||
# @PURPOSE: Executes the plugin's core logic.
|
||||
# @PARAM: params (Dict[str, Any]) - Validated input parameters.
|
||||
# @PRE: params must be a dictionary.
|
||||
# @POST: Plugin execution is completed.
|
||||
async def execute(self, params: Dict[str, Any]):
|
||||
with belief_scope("execute"):
|
||||
pass
|
||||
"""
|
||||
Executes the plugin's logic.
|
||||
The `params` argument will be validated against the schema returned by `get_schema()`.
|
||||
"""
|
||||
pass
|
||||
# [/DEF:execute:Function]
|
||||
# [/DEF:PluginBase:Class]
|
||||
|
||||
# [DEF:PluginConfig:Class]
|
||||
|
||||
Reference in New Issue
Block a user