Adjust the directory structure to prepare for merging into Master.

This commit is contained in:
Liu Zhicong
2023-09-27 11:40:46 -07:00
committed by tsukasa
parent 3a83783e3a
commit 29f83a6322
114 changed files with 378 additions and 160 deletions
+22
View File
@@ -0,0 +1,22 @@
import random
all_jokes = [
"""- Do you have a girl friend?
- yeah
- nice! Where is she from?
- A different nation
- Oh really? Which nation?
- Imagination""",
"""Q: Why is the letter B so cool?
A: Because it's sitting in the middle of the AC.""",
"""Teacher: Make a sentence using the word "I"
Student: I is..
Teacher: No that is not correct, you should say I am
Student: Ok. I am the ninth letter in the alphabet!""",
"""Teacher: Did your father help you with your homework?
Sam: No, he did it all by himself!"""
]
def random_joke():
return all_jokes[random.randint(0, len(all_jokes) - 1)]
@@ -0,0 +1,13 @@
from jarvis.functional_modules.functional_module import functional_module, CallerContext
import joke_db
@functional_module(
name="tell_joke",
description="Tell a joke. DO NOT come up with a joke if you call this function, this module will tell one.",
signature={})
async def do_nothing(context: CallerContext):
the_joke = joke_db.random_joke()
await context.reply_text(the_joke)
return the_joke