DiamondYin commited on
Commit
fb458de
·
1 Parent(s): a1cf93b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -84,8 +84,9 @@ def get_response(history, audio_input):
84
  api_key="07963fbc530a42f4ad223517decfd5fe",
85
  gpt_url="ws://spark-api.xf-yun.com/v1.1/chat",
86
  question= question)
87
- LOGGER.info("\ndocument_response: %s", answer)
88
- print('\ndocument_response:', answer)
 
89
 
90
  #for trigger in GENERAL_RSPONSE_TRIGGERS:
91
  #if trigger in str(answer):
@@ -98,12 +99,12 @@ def get_response(history, audio_input):
98
  # stop="\n"
99
  # )
100
  #answer = chat.choices[0].message.content
101
- MESSAGES.append({"role": "assistant", "content": answer})
102
- LOGGER.info("general_response: %s", answer)
103
- print('\ngeneral_response:', answer)
104
 
105
- AUDIO_HTML = text_to_speech_gen(answer)
106
- history[-1][1] = answer
107
 
108
  return history, AUDIO_HTML
109
 
 
84
  api_key="07963fbc530a42f4ad223517decfd5fe",
85
  gpt_url="ws://spark-api.xf-yun.com/v1.1/chat",
86
  question= question)
87
+ answer1 = str(answer)
88
+ LOGGER.info("\ndocument_response: %s", answer1)
89
+ print('\ndocument_response:', answer1)
90
 
91
  #for trigger in GENERAL_RSPONSE_TRIGGERS:
92
  #if trigger in str(answer):
 
99
  # stop="\n"
100
  # )
101
  #answer = chat.choices[0].message.content
102
+ MESSAGES.append({"role": "assistant", "content": answer1})
103
+ LOGGER.info("general_response: %s", answer1)
104
+ print('\ngeneral_response:', answer1)
105
 
106
+ AUDIO_HTML = text_to_speech_gen(answer1)
107
+ history[-1][1] = answer1
108
 
109
  return history, AUDIO_HTML
110