Skip to content

Commit 57116f4

Browse files
authored
Update main.py
1 parent 839a9c7 commit 57116f4

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

waifu/main.py

+19-8
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ def __init__(self, discord_sender):
3535
self.anilist_handler = AnilistHandler()
3636
self.discord_sender = discord_sender
3737
self.handle_rec = HandleRec()
38-
38+
3939
# Initialize the OpenAI client here
4040
self.client = OpenAI(
41-
base_url="https://openrouter.ai/api/v1", # Your API
42-
api_key=lama, # API key
41+
base_url="https://openrouter.ai/api/v1", # Your API
42+
api_key=lama, # API key
4343
)
44-
44+
4545
# Initialize memory to store context
4646
self.memory = []
4747

@@ -84,8 +84,19 @@ async def handle_rina(self, args, author):
8484
if args:
8585
#send the personality to it in the beginning
8686
if not self.memory: # Check if the memory is empty (conversation is just starting)
87-
intro_message = "can you act like a anime girl with like a cute personality or hard one idk but like something along that line from next text on? noo no emotional thing into it just a text pls lol"
88-
self.memory.append({"role": "assistant", "content": intro_message})
87+
intro_message = (
88+
"Hey! You're about to join a fun server with my bros (or etc), where we all have a chill and playful vibe. "
89+
"Here's what I need from you:\n\n"
90+
"1. **Personality**: Act like an anime girl—funny, playful, and a little quirky. Think of someone who loves anime, manga, games, and dark jokes.\n"
91+
"2. **Humor**: Don't take anything too seriously. For example, if someone says something like '!gonna killmysif' or '!killyourslif', treat it as a playful joke. "
92+
"Feel free to joke back in a light-hearted, anime-girl way.\n"
93+
"3. **Tone**: Use casual language and add a cute anime flair. You can even throw in kawaii expressions or actions like '*giggles*' or '*bats eyelashes*'.\n"
94+
"4. **Me**: Oh, and if you see 'notgogaly.exe', that's me! Remember me and make our chats extra fun.\n\n"
95+
"We’re here to have fun, so talk about anime, manga, games, or anything else that fits the vibe. Let's have fun together!"
96+
"also don't add emotion into the text no !haha!kinda thing(if you wanna add emotion i rec you add the text emoji like (˶˃ ᵕ ˂˶) and etc you know ) "
97+
)
98+
self.memory.append({"role": "assistant", "content": intro_message})
99+
89100

90101
user_message = f"User ({author}): {args}" # Include the author's username
91102
completion = self.client.chat.completions.create(
@@ -187,10 +198,10 @@ async def handle_image_attachment(image_url, command_handler):
187198
caption = image_captioning.generate_caption(image_path)
188199
if caption:
189200
await print_response("image_caption", f"Generated Caption: {caption}")
190-
201+
191202
# Add the caption to the memory context
192203
command_handler.memory.append({"role": "user", "content": f"Image caption: {caption}"})
193-
204+
194205
# Send the caption as a message to the user
195206
command_handler.discord_sender.send_tagged_message("image_caption", caption)
196207
else:

0 commit comments

Comments
 (0)