James Zeng commited on
Commit
4332868
·
1 Parent(s): 275d493

revert ask response to previous behavior

Browse files
Files changed (1) hide show
  1. src/EdgeGPT.py +2 -2
src/EdgeGPT.py CHANGED
@@ -187,7 +187,7 @@ class ChatHub:
187
  yield False, response["arguments"][0]["messages"][0]["adaptiveCards"][0]["body"][0]["text"]
188
  elif response.get("type") == 2:
189
  final = True
190
- yield True, response["item"]["messages"][1]["adaptiveCards"][0]["body"][0]["text"]
191
 
192
  async def __initial_handshake(self):
193
  await self.wss.send(append_identifier({"protocol": "json", "version": 1}))
@@ -287,7 +287,7 @@ async def main():
287
  continue
288
  print("Bot:")
289
  if not args.stream:
290
- print(await bot.ask(prompt=prompt))
291
  else:
292
  wrote = 0
293
  async for final, response in bot.ask_stream(prompt=prompt):
 
187
  yield False, response["arguments"][0]["messages"][0]["adaptiveCards"][0]["body"][0]["text"]
188
  elif response.get("type") == 2:
189
  final = True
190
+ yield True, response
191
 
192
  async def __initial_handshake(self):
193
  await self.wss.send(append_identifier({"protocol": "json", "version": 1}))
 
287
  continue
288
  print("Bot:")
289
  if not args.stream:
290
+ print((await bot.ask(prompt=prompt))["item"]["messages"][1]["adaptiveCards"][0]["body"][0]["text"])
291
  else:
292
  wrote = 0
293
  async for final, response in bot.ask_stream(prompt=prompt):