Skip to content

Commit

Permalink
fix: 废弃activeMode(wzpan#224); robot 加回ChatGPT的选项(wzpan#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
wzpan committed Apr 1, 2023
1 parent 4c42f43 commit 670e364
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
9 changes: 2 additions & 7 deletions robot/Conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,12 @@ def appendHistory(self, t, text, UUID="", plugin=""):
)

def _onCompleted(self, msg):
if config.get("active_mode", False) and (
msg.endswith("?") or msg.endswith("?") or "告诉我" in msg or "请回答" in msg
):
query = self.activeListen()
self.doResponse(query)
pass

def pardon(self):
if not self.hasPardon:
self.say(
"抱歉,刚刚没听清,能再说一遍吗?",
onCompleted=lambda: self.doResponse(self.activeListen()),
"抱歉,刚刚没听清,能再说一遍吗?", cache=True
)
self.hasPardon = True
else:
Expand Down
4 changes: 1 addition & 3 deletions static/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ LED:
enable: false
type: aiy # aiy: Google AIY Voice Kit; respeaker:respeaker 2Mics

# 当机器人反问用户时,是否自动进入下一轮聆听
active_mode: true

# 勿扰模式,该时间段内自动进入睡眠,避免监听
do_not_bother:
enable: false # true: 开启; false: 关闭
Expand Down Expand Up @@ -186,6 +183,7 @@ nlu_engine: unit
# openai - OpenAI ChatGPT(要求 Python >= 3.7.1)
# anyq - AnyQ
# tuling - 图灵机器人
# openai - OpenAI ChatGPT
robot: unit

# 百度 UNIT
Expand Down

0 comments on commit 670e364

Please sign in to comment.