Closed transfaeries closed 2 years ago
@technillogue @iamalwaysuncomfortable I want your opinion on the data structures for the dialogs.
right now it's a Tree of list, each list has one human message and one bot reply (which, doesn't account for bots that send multiple replies so already we need something a bit more sophisticated)
tree = Tree(
["test_ask_yesno_question", "Do you like faeries?"],
[Tree(["yes", "That's cool, me too!"]), Tree(["no", "Aww :c"])],
)
Any thoughts on a better way of doing it?
Also, I get 5 warnings when I run tests. Is that something we just have to live with? or is there a way to address them
how do I specify that children should be a list of trees? list [Tree]
doesn't work
class Tree:
"""tree implementation for test dialog trees"""
def __init__(self, dialog: list[str], children: list = None) -> None:
how do I specify that children should be a list of trees?
list [Tree]
doesn't workclass Tree: """tree implementation for test dialog trees""" def __init__(self, dialog: list[str], children: list = None) -> None:
what's the error?
with
def __init__(self, dialog: list[str], children: list[Tree] = None) -> None:
I get:
forest/mockbot.py:57:57: E0601: Using variable 'Tree' before assignment (used-before-assignment)
use def __init__(self, dialog: list[str], children: list["Tree"] = None) -> None:
Here's the test stuff I've been working on. I moved MockBot to it's own file at forest/mockbot.py, use it to run six tests between test_unit.py and test_questions_bot.py. There is now a clear path to turn all the functions in test_questions_bot.py into real tests.
However, as far as I know, I can't run test_questions_bot.py as a normal bot anymore. Which I would like. So help in making that happen would be nice.