From d1ee3d7dbd9dd1309c1d71656a2ac2d855e2860d Mon Sep 17 00:00:00 2001 From: Gene Kogan Date: Wed, 13 Dec 2023 18:41:59 -0800 Subject: [PATCH] kojii --- src/bots/kojii/KojiiAssistantCog.py | 31 ----------------------------- src/bots/kojii/KojiiCharacterCog.py | 11 ++++++++++ src/bots/kojii/KojiiGeneratorCog.py | 15 ++++---------- 3 files changed, 15 insertions(+), 42 deletions(-) delete mode 100644 src/bots/kojii/KojiiAssistantCog.py create mode 100644 src/bots/kojii/KojiiCharacterCog.py diff --git a/src/bots/kojii/KojiiAssistantCog.py b/src/bots/kojii/KojiiAssistantCog.py deleted file mode 100644 index 82d301f..0000000 --- a/src/bots/kojii/KojiiAssistantCog.py +++ /dev/null @@ -1,31 +0,0 @@ -from pathlib import Path -from discord.ext import commands -from cogs.AssistantCog import AssistantCog, LoraInput -from common.models import EdenAssistantConfig - - -class KojiiAssistantCog(AssistantCog): - def __init__(self, bot: commands.bot) -> None: - lora = LoraInput( - lora_id="65642f6a730b5e00f6f243d6", - lora_strength=0.65, - lora_trigger="kojii", - require_lora_trigger=True, - ) - assistant_config = EdenAssistantConfig( - character_description=self.load_prompt("character_description.txt"), - creator_prompt=self.load_prompt("creator_prompt.txt"), - documentation_prompt=self.load_prompt("documentation_prompt.txt"), - documentation=self.load_prompt("documentation.txt"), - router_prompt=self.load_prompt("router_prompt.txt"), - ) - super().__init__(bot, assistant_config, lora) - - def load_prompt(self, fname: str) -> str: - path = Path(__file__).parent / "prompts" / fname - with open(path, "r") as f: - return f.read() - - -def setup(bot: commands.Bot) -> None: - bot.add_cog(KojiiAssistantCog(bot)) diff --git a/src/bots/kojii/KojiiCharacterCog.py b/src/bots/kojii/KojiiCharacterCog.py new file mode 100644 index 0000000..5f30331 --- /dev/null +++ b/src/bots/kojii/KojiiCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterCog import CharacterCog + + +class KojiiCharacterCog(CharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(KojiiCharacterCog(bot)) diff --git a/src/bots/kojii/KojiiGeneratorCog.py b/src/bots/kojii/KojiiGeneratorCog.py index 02c31aa..8146ef8 100644 --- a/src/bots/kojii/KojiiGeneratorCog.py +++ b/src/bots/kojii/KojiiGeneratorCog.py @@ -1,18 +1,11 @@ from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog -from cogs.GeneratorCog import GeneratorCog, LoraInput - -class KojiiGeneratorCog(GeneratorCog): +class KojiiCharacterGeneratorCog(CharacterGeneratorCog): def __init__(self, bot: commands.bot) -> None: - lora = LoraInput( - lora_id="65642f6a730b5e00f6f243d6", - lora_strength=0.65, - lora_trigger="kojii", - require_lora_trigger=True, - ) - super().__init__(bot, lora) + super().__init__(bot) def setup(bot: commands.Bot) -> None: - bot.add_cog(KojiiGeneratorCog(bot)) + bot.add_cog(KojiiCharacterGeneratorCog(bot))