Skip to content

Commit

Permalink
bunch of upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
genekogan committed Oct 26, 2023
1 parent 116285c commit 18d7022
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions bots/eden_bot/eden_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@
ALLOWED_CHANNELS = CONFIG["allowed_channels"]
ALLOWED_LERP_BACKDOOR_USERS = CONFIG["allowed_channels"]


# experimental
os.environ['OPENAI_API_KEY'] = os.environ['LM_OPENAI_API_KEY']
from logos.scenarios import EdenAssistant



@dataclass
class GenerationLoopInput:
api_url: str
Expand Down Expand Up @@ -524,13 +522,18 @@ async def on_message(self, message: discord.Message) -> None:
attachment_lookup_url = {v: k for k, v in attachment_lookup_file.items()}
attachment_files = [attachment_lookup_file[url] for url in attachment_urls]

response = await self.assistant({
assistant_message = {
"prompt": prompt,
"attachments" : attachment_files
})
}

response = await self.assistant(
assistant_message,
session_id=str(message.author.id)
)

reply = response["message"]
await message.reply(reply)
reply = response["message"][:2000]
reply_message = await message.reply(reply)

# check if there is a config
config = response["attachment"]
Expand Down Expand Up @@ -559,16 +562,17 @@ async def on_message(self, message: discord.Message) -> None:
**config
)

start_bot_message = f"**{text_input}** - author\n"
creation_message = await ctx.channel.send(start_bot_message)
source = self.get_source(ctx)

is_video_request = mode in ["interpolate", "real2real"]

start_bot_message = f"**{text_input}** - <@!{ctx.author.id}>\n"
original_text = f"{reply[0:1950-len(start_bot_message)]}\n\n{start_bot_message}"

generation_loop_input = GenerationLoopInput(
api_url=EDEN_API_URL,
message=creation_message,
start_bot_message=start_bot_message,
message=reply_message,
start_bot_message=original_text,
source=source,
config=config,
prefer_gif=False,
Expand Down

0 comments on commit 18d7022

Please sign in to comment.