Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: SyntaxError with package name #1

Open
1 task done
katanhich opened this issue Oct 27, 2023 · 7 comments
Open
1 task done

[Bug]: SyntaxError with package name #1

katanhich opened this issue Oct 27, 2023 · 7 comments

Comments

@katanhich
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

Hi @ZackBradshaw
I cant not import bing-chat due to SyntaxError. Here is the result:

from bing-chat import BingChat
         ^

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

NO

Console logs

from bing-chat import BingChat
             ^
SyntaxError: invalid syntax

Additional information

No response

@ZackBradshaw
Copy link
Contributor

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 :)

@marina-yurieva
Copy link

I have the same issue. What's the fix for it?

@dogweather
Copy link

Has anyone found a workaround?

@YashIngole
Copy link

found any fix yet?

@dogweather
Copy link

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.

@farrukh-aftab-ahmed
Copy link

farrukh-aftab-ahmed commented Feb 9, 2024

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())

@catpupu
Copy link

catpupu commented Mar 13, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants