Skip to content

Commit

Permalink
revert ask response to previous behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
James Zeng committed Feb 10, 2023
1 parent 275d493 commit 4332868
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EdgeGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async def ask_stream(self, prompt: str) -> str:
yield False, response["arguments"][0]["messages"][0]["adaptiveCards"][0]["body"][0]["text"]
elif response.get("type") == 2:
final = True
yield True, response["item"]["messages"][1]["adaptiveCards"][0]["body"][0]["text"]
yield True, response

async def __initial_handshake(self):
await self.wss.send(append_identifier({"protocol": "json", "version": 1}))
Expand Down Expand Up @@ -287,7 +287,7 @@ async def main():
continue
print("Bot:")
if not args.stream:
print(await bot.ask(prompt=prompt))
print((await bot.ask(prompt=prompt))["item"]["messages"][1]["adaptiveCards"][0]["body"][0]["text"])
else:
wrote = 0
async for final, response in bot.ask_stream(prompt=prompt):
Expand Down

0 comments on commit 4332868

Please sign in to comment.