|
|
@ -153,7 +153,7 @@ async def listener():
|
|
|
|
messages = json.load(file)
|
|
|
|
messages = json.load(file)
|
|
|
|
messages.append(message)
|
|
|
|
messages.append(message)
|
|
|
|
with open(conversation_history_path, 'w') as file:
|
|
|
|
with open(conversation_history_path, 'w') as file:
|
|
|
|
json.dump(messages, file)
|
|
|
|
json.dump(messages, file, indent=4)
|
|
|
|
|
|
|
|
|
|
|
|
accumulated_text = ""
|
|
|
|
accumulated_text = ""
|
|
|
|
|
|
|
|
|
|
|
@ -193,7 +193,7 @@ async def listener():
|
|
|
|
await from_user.put(temp_message)
|
|
|
|
await from_user.put(temp_message)
|
|
|
|
|
|
|
|
|
|
|
|
with open(conversation_history_path, 'w') as file:
|
|
|
|
with open(conversation_history_path, 'w') as file:
|
|
|
|
json.dump(interpreter.messages, file)
|
|
|
|
json.dump(interpreter.messages, file, indent=4)
|
|
|
|
|
|
|
|
|
|
|
|
print("New user message recieved. Breaking.")
|
|
|
|
print("New user message recieved. Breaking.")
|
|
|
|
break
|
|
|
|
break
|
|
|
@ -202,11 +202,14 @@ async def listener():
|
|
|
|
if not from_computer.empty():
|
|
|
|
if not from_computer.empty():
|
|
|
|
|
|
|
|
|
|
|
|
with open(conversation_history_path, 'w') as file:
|
|
|
|
with open(conversation_history_path, 'w') as file:
|
|
|
|
json.dump(interpreter.messages, file)
|
|
|
|
json.dump(interpreter.messages, file, indent=4)
|
|
|
|
|
|
|
|
|
|
|
|
print("New computer message recieved. Breaking.")
|
|
|
|
print("New computer message recieved. Breaking.")
|
|
|
|
break
|
|
|
|
break
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
with open(conversation_history_path, 'w') as file:
|
|
|
|
|
|
|
|
json.dump(interpreter.messages, file, indent=4)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def stream_or_play_tts(sentence):
|
|
|
|
async def stream_or_play_tts(sentence):
|
|
|
|
|
|
|
|
|
|
|
|