Open katanhich opened 10 months ago
Thanks for your issue report. I'm switching over to a more unified method for the pip package hopefully this will solve your issues . I'll ping you when this is done :)
I have the same issue. What's the fix for it?
Has anyone found a workaround?
found any fix yet?
I forked the repo, fixed this, and then found a ton of other issues. There's no test suite, so it's hard to know what works and what doesn't. I stopped after investing an hour of work.
Replace your code with this code.
import logging
from bing_chat import BingGPT
import asyncio
async def main():
logging.basicConfig(level=logging.INFO)
c = BingGPT.Chatbot()
response = await c.ask("Hello, how are you?")
messages = response['item']['messages']
print("Chat history:", messages)
asyncio.run(main())
Replace your code with this code.
import logging from bing_chat import BingGPT import asyncio async def main(): logging.basicConfig(level=logging.INFO) c = BingGPT.Chatbot() response = await c.ask("Hello, how are you?") messages = response['item']['messages'] print("Chat history:", messages) asyncio.run(main())
I got this error
Traceback (most recent call last):
File ~\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)
File c:\users\lucas\.spyder-py3\temp.py:18
asyncio.run(main())
File ~\anaconda3\Lib\asyncio\runners.py:186 in run
raise RuntimeError(
RuntimeError: asyncio.run() cannot be called from a running event loop
Is there an existing issue for this?
What happened?
Hi @ZackBradshaw I cant not import bing-chat due to SyntaxError. Here is the result:
SyntaxError: invalid syntax
Steps to reproduce the problem
from bing-chat import BingChat
What should have happened?
It should be imported properly
Version where the problem happens
1.9.4
What Python version are you running this with?
3.9
What is your operating system ?
Windows
Command Line Arguments
Console logs
Additional information
No response