轮流互动的框架
项目描述
自述文件
轮流互动的框架。
例子
这是来自example.py,使用终端界面,并演示了几件事:
-
一种基于计划的结构,使用图表来指导内容流
-
文本变化,包括心理问题的有序变化
-
将用户输入写入数据库
-
从数据库中读取以填充文本
-
通过对数据输入运行的测试进行错误检查,包括在用户提供无效输入时自动显示错误消息
-
确认有效的用户输入,这是通过在创建消息时指定一个布尔参数来实现的
-
使用扩展的通用接口类以使该交互显示在终端上
===================== Hola 0. Hi >>> 0 ===================== What's your name? >>> AJ ===================== 'AJ', right? 0. Yes 1. No >>> 1 ===================== What's your name? >>> Audrow ===================== 'Audrow', right? 0. Yes 1. No >>> 0 ===================== Alright, Audrow, how old are you? >>> 1000 ===================== Enter a number between 0 and 200 0. Okay 1. Oops >>> 0 ===================== Alright, Audrow, how old are you? >>> 27 ===================== How are you? 0. Good 1. Okay 2. Bad >>> 0 ===================== How do you feel about the following statement? 'I am the life of the party' 0. Strongly agree 1. Agree 2. Neutral 3. disagree 4. Strongly disagree >>> 1 ===================== How do you feel about the following statement? 'I am always prepared' 0. Strongly agree 1. Agree 2. Neutral 3. disagree 4. Strongly disagree >>> 1 ===================== How do you feel about the following statement? 'I get stressed out easily' 0. Strongly agree 1. Agree 2. Neutral 3. disagree 4. Strongly disagree >>> 3 ===================== Bye 0. Bye 1. See ya! >>> 1 ========================= Currently in the database {'answers': ['Agree', 'Agree', 'disagree'], 'question_idx': 3, 'user_age': 27.0, 'user_name': 'Audrow'}
设置
选项 1:克隆存储库
如果您想修改或查看代码最好 - 请注意,您可以在虚拟环境中执行以下操作
git clone https://github.com/robotpt/interaction-engine
使用其依赖项和 Python 路径设置存储库的一种简单方法是使用pip.
pip install -e interaction-engine
可以使用以下命令运行测试。
cd interaction-engine
python3 -m unittest
选项 2:使用点
如果你只想使用它最好
python3 -m pip install interaction_engine