Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

[Bug]: cannot import name 'Chatbot' from 'EdgeGPT' #620

Open
1 task done
qq1350657030 opened this issue Jul 19, 2023 · 2 comments
Open
1 task done

[Bug]: cannot import name 'Chatbot' from 'EdgeGPT' #620

qq1350657030 opened this issue Jul 19, 2023 · 2 comments

Comments

@qq1350657030
Copy link

Is there an existing issue for this?

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

What happened?

python3 app.py
Load config success
[INFO][2023-07-19 15:35:10][plugin_registry.py:23] - Plugin Selector_v0.1 registered
[INFO][2023-07-19 15:35:10][log.py:32] - [Selector] inited
[WARNING][2023-07-19 15:35:10][log.py:39] - Failed to import plugin createimg
Load config success
[INFO][2023-07-19 15:35:10][log.py:34] - [MultiChannel] Start up bing on terminal

Please input your question
User:
pp
Bot:
[ERROR][2023-07-19 15:35:13][log.py:47] - [MultiChannel] Start up failed on terminal: cannot import name 'Chatbot' from 'EdgeGPT' (/home/hoyoverse/.local/lib/python3.10/site-packages/EdgeGPT/init.py)
[ERROR][2023-07-19 15:35:13][log.py:45] - App startup failed!
[ERROR][2023-07-19 15:35:13][log.py:50] - cannot import name 'Chatbot' from 'EdgeGPT' (/home/hoyoverse/.local/lib/python3.10/site-packages/EdgeGPT/init.py)
Traceback (most recent call last):
File "/home/hoyoverse/bot-on-anything/app.py", line 42, in main
start_process(channel_type[0], args.config)
File "/home/hoyoverse/bot-on-anything/app.py", line 23, in start_process
raise e
File "/home/hoyoverse/bot-on-anything/app.py", line 20, in start_process
channel.startup()
File "/home/hoyoverse/bot-on-anything/channel/terminal/terminal_channel.py", line 21, in startup
for res in super().build_reply_content(prompt, context):
File "/home/hoyoverse/bot-on-anything/channel/channel.py", line 31, in build_reply_content
return Bridge().fetch_reply_content(query, context)
File "/home/hoyoverse/bot-on-anything/bridge/bridge.py", line 18, in fetch_reply_content
return model_factory.create_bot(type).reply(query, context)
File "/home/hoyoverse/bot-on-anything/model/model_factory.py", line 29, in create_bot
from model.bing.new_bing_model import BingModel
File "/home/hoyoverse/bot-on-anything/model/bing/new_bing_model.py", line 6, in
from EdgeGPT import Chatbot, ConversationStyle
ImportError: cannot import name 'Chatbot' from 'EdgeGPT' (/home/hoyoverse/.local/lib/python3.10/site-packages/EdgeGPT/init.py)

Steps to reproduce the problem

  1. Install all necessary components according to the documentation
  2. Run python3 app.py after entering bing cookie

What should have happened?

It should be running.

Version where the problem happens

Name: EdgeGPT
Version: 0.12.1
Summary: Reverse engineered Edge Chat API
Home-page: https://github.com/acheong08/EdgeGPT
Author: Antonio Cheong
Author-email: [email protected]
License: GNU General Public License v2.0
Location: /home/hoyoverse/.local/lib/python3.10/site-packages
Requires: aiohttp, BingImageCreator, certifi, httpx, prompt-toolkit, requests, rich, websockets
Required-by:

What Python version are you running this with?

3.11.4

What is your operating system ?

Linux, Other/Cloud

Command Line Arguments

Console logs

[ERROR][2023-07-19 15:35:13][log.py:47] - [MultiChannel] Start up failed on terminal: cannot import name 'Chatbot' from 'EdgeGPT' (/home/hoyoverse/.local/lib/python3.10/site-packages/EdgeGPT/__init__.py)
[ERROR][2023-07-19 15:35:13][log.py:45] - App startup failed!
[ERROR][2023-07-19 15:35:13][log.py:50] - cannot import name 'Chatbot' from 'EdgeGPT' (/home/hoyoverse/.local/lib/python3.10/site-packages/EdgeGPT/__init__.py)
Traceback (most recent call last):
  File "/home/hoyoverse/bot-on-anything/app.py", line 42, in main
    start_process(channel_type[0], args.config)
  File "/home/hoyoverse/bot-on-anything/app.py", line 23, in start_process
    raise e
  File "/home/hoyoverse/bot-on-anything/app.py", line 20, in start_process
    channel.startup()
  File "/home/hoyoverse/bot-on-anything/channel/terminal/terminal_channel.py", line 21, in startup
    for res in super().build_reply_content(prompt, context):
  File "/home/hoyoverse/bot-on-anything/channel/channel.py", line 31, in build_reply_content
    return Bridge().fetch_reply_content(query, context)
  File "/home/hoyoverse/bot-on-anything/bridge/bridge.py", line 18, in fetch_reply_content
    return model_factory.create_bot(type).reply(query, context)
  File "/home/hoyoverse/bot-on-anything/model/model_factory.py", line 29, in create_bot
    from model.bing.new_bing_model import BingModel
  File "/home/hoyoverse/bot-on-anything/model/bing/new_bing_model.py", line 6, in <module>
    from EdgeGPT import Chatbot, ConversationStyle
ImportError: cannot import name 'Chatbot' from 'EdgeGPT' (/home/hoyoverse/.local/lib/python3.10/site-packages/EdgeGPT/__init__.py)

Additional information

No response

@cousintiz
Copy link

I think you gotta import it like: from EdgeGPT.EdgeGPT import Chatbot

@xbzstudio
Copy link

from EdgeGPT.EdgeGPT import Chatbot

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

No branches or pull requests

3 participants