From a0b8fe3e157aa896ae65e323581f5b64a652b0da Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@proton.me> Date: Mon, 26 Jun 2023 10:40:22 +0200 Subject: [PATCH] fix: disable text gen --- matrixai/__init__.py | 53 ++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/matrixai/__init__.py b/matrixai/__init__.py index 83d6094..066d5c7 100644 --- a/matrixai/__init__.py +++ b/matrixai/__init__.py @@ -11,7 +11,7 @@ USERNAME = os.environ.get("MATRIX_USERNAME", "ai") SERVER = os.environ.get("MATRIX_SERVER", "https://matrix.projectsegfau.lt") PASSWORD = os.environ.get("MATRIX_PASSWORD", None) -ENABLE_AI_COMMAND = os.environ.get("ENABLE_AI_COMMAND", True) +ENABLE_AI_COMMAND = os.environ.get("ENABLE_AI_COMMAND", False) ENABLE_IMAGE_COMMAND = os.environ.get("ENABLE_IMAGE_COMMAND", True) ENABLE_INSPIRE_COMMAND = os.environ.get("ENABLE_INSPIRE_COMMAND", True) @@ -209,41 +209,26 @@ def run(): styles = ", ".join([style.name for style in Style]) ratios = ", ".join([ratio.name for ratio in Ratio]) inspirations = "- ".join([f"{inspiration.name}={inspiration.value[0]}\n" for inspiration in Inspiration]) + # ask: + # command: {", ".join(AI_COMMAND_ALIASES)} + # description: ask gpt a question bot_help_message = f""" -Help Message: - prefix: {PREFIX} - commands: - help: - command: help, ?, h - description: display help command - ask: - command: {", ".join(AI_COMMAND_ALIASES)} - description: ask gpt a question - img: - command: {", ".join(IMAGE_COMMAND_ALIASES)} - description: generate an image from a prompt - options: - neg: - description: negative prompt - example: neg=low - style: - description: style of image - example: style=IMAGINE_V3 - values: {styles} - ratio: - description: ratio of image - example: ratio=RATIO_1X1 - values: {ratios} - inspire: - command: {", ".join(INSPIRE_COMMAND_ALIASES)} - description: generate an image from an inspiration - options: - inspiration: - description: inspiration of image - example: INSPIRATION_01 - values: {inspirations} +# Help of `@ai:psf.lt` - """ +- `!help`, `!?`, `!h`: display help command +- `{"`, `".join(IMAGE_COMMAND_ALIASES)}`: generate an image from a prompt + options: + - `neg`: negative prompt + example: `neg=low` + - `style`: style of image + example: `style=IMAGINE_V3` + values: {styles} + - `ratio`: ratio of image + example: `ratio=RATIO_1X1` + values: {ratios} + +For text generation, invite `@ai:psf.lt` +""" match = botlib.MessageMatch(room, message, bot, PREFIX) if ( match.is_not_from_this_bot()