mirror of
https://github.com/aljazceru/enclava.git
synced 2025-12-17 23:44:24 +01:00
more cleanup
This commit is contained in:
@@ -164,196 +164,6 @@ def get_zammad_configuration_schema() -> Dict[str, Any]:
|
||||
}
|
||||
|
||||
|
||||
def get_signal_configuration_schema() -> Dict[str, Any]:
|
||||
"""
|
||||
Returns the configuration schema for the Signal Bot plugin.
|
||||
Based on the existing Signal module implementation.
|
||||
"""
|
||||
return {
|
||||
"type": "object",
|
||||
"title": "Signal Bot Configuration",
|
||||
"description": "Configure AI-powered Signal messaging bot with role-based permissions",
|
||||
"properties": {
|
||||
# Basic Settings
|
||||
"enable_signal_bot": {
|
||||
"type": "boolean",
|
||||
"title": "Enable Signal Bot",
|
||||
"description": "Turn the Signal bot on/off",
|
||||
"default": False,
|
||||
"required": True
|
||||
},
|
||||
"signal_service_url": {
|
||||
"type": "url",
|
||||
"title": "Signal Service URL",
|
||||
"description": "Signal service endpoint (e.g., signal-cli-rest-api)",
|
||||
"required": True,
|
||||
"placeholder": "http://localhost:8080",
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
"bot_phone_number": {
|
||||
"type": "string",
|
||||
"title": "Bot Phone Number",
|
||||
"description": "Registered Signal phone number for the bot",
|
||||
"required": True,
|
||||
"placeholder": "+1234567890",
|
||||
"pattern": "^\\+[1-9]\\d{1,14}$",
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
|
||||
# AI Settings
|
||||
"model": {
|
||||
"type": "select",
|
||||
"title": "AI Model",
|
||||
"description": "Choose the AI model for responses",
|
||||
"required": False,
|
||||
"default": "privatemode-llama-3-70b",
|
||||
"options": [], # Will be populated from available models
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
"temperature": {
|
||||
"type": "number",
|
||||
"title": "Response Creativity",
|
||||
"description": "Control response creativity (0.0-1.0)",
|
||||
"required": False,
|
||||
"default": 0.7,
|
||||
"minimum": 0.0,
|
||||
"maximum": 1.0,
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
"max_tokens": {
|
||||
"type": "integer",
|
||||
"title": "Max Response Length",
|
||||
"description": "Maximum tokens in AI responses",
|
||||
"required": False,
|
||||
"default": 500,
|
||||
"minimum": 50,
|
||||
"maximum": 2000,
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
"memory_length": {
|
||||
"type": "integer",
|
||||
"title": "Conversation Memory",
|
||||
"description": "Number of message pairs to remember per user",
|
||||
"required": False,
|
||||
"default": 10,
|
||||
"minimum": 1,
|
||||
"maximum": 50,
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
|
||||
# Permission Settings
|
||||
"default_role": {
|
||||
"type": "select",
|
||||
"title": "Default User Role",
|
||||
"description": "Role assigned to new Signal users",
|
||||
"required": False,
|
||||
"default": "user",
|
||||
"options": [
|
||||
{"value": "admin", "label": "Admin"},
|
||||
{"value": "user", "label": "User"},
|
||||
{"value": "disabled", "label": "Disabled"}
|
||||
],
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
"auto_register": {
|
||||
"type": "boolean",
|
||||
"title": "Auto-Register New Users",
|
||||
"description": "Automatically register new Signal users",
|
||||
"default": True,
|
||||
"required": False,
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
"admin_phone_numbers": {
|
||||
"type": "textarea",
|
||||
"title": "Admin Phone Numbers",
|
||||
"description": "Phone numbers with admin privileges (one per line)",
|
||||
"required": False,
|
||||
"placeholder": "+1234567890\n+0987654321",
|
||||
"rows": 3,
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
|
||||
# Bot Behavior
|
||||
"command_prefix": {
|
||||
"type": "string",
|
||||
"title": "Command Prefix",
|
||||
"description": "Prefix for bot commands",
|
||||
"required": False,
|
||||
"default": "!",
|
||||
"placeholder": "!",
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
},
|
||||
"log_conversations": {
|
||||
"type": "boolean",
|
||||
"title": "Log Conversations",
|
||||
"description": "Enable conversation logging for analytics",
|
||||
"default": False,
|
||||
"required": False,
|
||||
"depends_on": {
|
||||
"field": "enable_signal_bot",
|
||||
"value": True
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["enable_signal_bot"],
|
||||
"field_groups": [
|
||||
{
|
||||
"title": "Basic Settings",
|
||||
"fields": ["enable_signal_bot", "signal_service_url", "bot_phone_number"]
|
||||
},
|
||||
{
|
||||
"title": "AI Configuration",
|
||||
"fields": ["model", "temperature", "max_tokens", "memory_length"]
|
||||
},
|
||||
{
|
||||
"title": "Permission Settings",
|
||||
"fields": ["default_role", "auto_register", "admin_phone_numbers"]
|
||||
},
|
||||
{
|
||||
"title": "Bot Behavior",
|
||||
"fields": ["command_prefix", "log_conversations"]
|
||||
}
|
||||
],
|
||||
"validation": {
|
||||
"signal_test": {
|
||||
"endpoint": "/api/v1/signal/test-connection",
|
||||
"method": "POST",
|
||||
"fields": ["signal_service_url", "bot_phone_number"],
|
||||
"success_message": "Signal service connection successful",
|
||||
"error_field": "Signal connection failed"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def get_email_assistant_configuration_schema() -> Dict[str, Any]:
|
||||
@@ -471,7 +281,6 @@ def get_plugin_configuration_schema(plugin_id: str) -> Optional[Dict[str, Any]]:
|
||||
"""
|
||||
schemas = {
|
||||
"zammad": get_zammad_configuration_schema,
|
||||
"signal": get_signal_configuration_schema,
|
||||
"email-assistant": get_email_assistant_configuration_schema
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user