Skip to content

Commit

Permalink
修复api 聊天模式相关bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Dec 17, 2023
1 parent 932f44a commit 8c0b8e9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging, os, sys, json
import threading
import schedule
import schedule, time
import random
import aiohttp, asyncio
import traceback
Expand Down Expand Up @@ -1394,9 +1394,11 @@ def run_live(self):
# 冷却时间 0.3 秒
cooldown = 0.3
last_pressed = 0

stop_do_listen_and_comment_thread_event = threading.Event()

signal.signal(signal.SIGINT, exit_handler)
signal.signal(signal.SIGTERM, exit_handler)
# signal.signal(signal.SIGINT, exit_handler)
# signal.signal(signal.SIGTERM, exit_handler)

# 录音功能(录音时间过短进入openai的语音转文字会报错,请一定注意)
def record_audio():
Expand Down Expand Up @@ -2026,7 +2028,7 @@ def sys_cmd():
if data_json['type'] == 'run':
"""
{
"type": "factory",
"type": "run",
"data": {
"config_path": "config.json"
}
Expand All @@ -2037,7 +2039,7 @@ def sys_cmd():
elif data_json['type'] =='stop':
"""
{
"type": "factory",
"type": "stop",
"data": {
"config_path": "config.json"
}
Expand Down

0 comments on commit 8c0b8e9

Please sign in to comment.