yihong0618 / xiaogpt

Play ChatGPT and other LLM with Xiaomi AI Speaker
MIT License
5.86k stars 817 forks source link

TypeError: 'type' object is not subscriptable #438

Closed jacket230 closed 5 months ago

jacket230 commented 5 months ago
def videos(self) -> list[BardYoutubeVideo]:

TypeError: 'type' object is not subscriptable

yihong0618 commented 5 months ago

you use bard? please try gemini, will take a look this issue later

jacket230 commented 5 months ago

Traceback (most recent call last): File "xiaogpt.py", line 2, in from xiaogpt.cli import main File "c:\xiaogpt-main\xiaogpt\cli.py", line 5, in from xiaogpt.xiaogpt import MiGPT File "c:\xiaogpt-main\xiaogpt\xiaogpt.py", line 18, in from xiaogpt.bot import get_bot File "c:\xiaogpt-main\xiaogpt\bot__init.py", line 8, in from xiaogpt.bot.bard_bot import BardBot File "c:\xiaogpt-main\xiaogpt\bot\bard_bot.py", line 6, in from bardapi import BardAsync File "C:\Users\jack\AppData\Local\Programs\Python\Python38\lib\site-packages\bardapi\init__.py", line 4, in from bardapi.core import Bard File "C:\Users\jack\AppData\Local\Programs\Python\Python38\lib\site-packages\bardapi\core.py", line 30, in from bardapi.models.result import BardResult File "C:\Users\jack\AppData\Local\Programs\Python\Python38\lib\site-packages\bardapi\models\result.py", line 3, in from bardapi.models.draft import BardDraft File "C:\Users\jack\AppData\Local\Programs\Python\Python38\lib\site-packages\bardapi\models\draft.py", line 14, in from bardapi.models.tools.youtube import BardYoutubeContent File "C:\Users\jack\AppData\Local\Programs\Python\Python38\lib\site-packages\bardapi\models\tools\youtube.py", line 38, in class BardYoutubeContent(UserContent): File "C:\Users\jack\AppData\Local\Programs\Python\Python38\lib\site-packages\bardapi\models\tools\youtube.py", line 63, in BardYoutubeContent def videos(self) -> list[BardYoutubeVideo]: TypeError: 'type' object is not subscriptable

jacket230 commented 5 months ago

"verbose": false, "bot": "chatgptapi", "tts": "mi", "edge_tts_voice": "zh-CN-XiaoxiaoNeural",

jacket230 commented 5 months ago

"openai_key": "sk-N**", "glm_key": "", "gemini_key": "", "qwen_key": "", "bard_token": "", "serpapi_api_key": "",

jacket230 commented 5 months ago

没有用bard,为啥会跑到bard这个逻辑里面去了呢?

yihong0618 commented 5 months ago

@jacket230 先试试这个 pip install bardapi==0.1.38

jacket230 commented 5 months ago

安装了这个包,还是一样的提示。我的启动命令是不是不对? python xiaogpt.py --hardware LX05 --mute_xiaoai --use_gpt3

yihong0618 commented 5 months ago

对但别用 gpt3 用 chatgptapi

jacket230 commented 5 months ago

python xiaogpt.py --hardware LX05 --mute_xiaoai --use_chatgptapi
这个错误依然出现,我安装的时候用的:
pip install -U --force-reinstall xiaogpt

ef videos(self) -> list[BardYoutubeVideo]: TypeError: 'type' object is not subscriptable

yihong0618 commented 5 months ago

pip install -U --force-reinstall xiaogpt pip install bardapi==0.1.38

jacket230 commented 5 months ago

pip install -U --force-reinstall xiaogpt pip install bardapi==0.1.38

重新执行了这两个命令,还是提示TypeError: 'type' object is not subscriptable

frostming commented 5 months ago

重新执行了这两个命令,还是提示TypeError: 'type' object is not subscriptable

用python 3.9以上,直接没烦恼

jacket230 commented 5 months ago

重新执行了这两个命令,还是提示TypeError: 'type' object is not subscriptable

用python 3.9以上,直接没烦恼

好嘞,我试试3.9以上,我现在是3.8.

yihong0618 commented 5 months ago

@jacket230 3.9 可以了么?如果没问题我去上游提个 issue

jacket230 commented 5 months ago

@jacket230 3.9 可以了么?如果没问题我去上游提个 issue

还在安装,为啥说: INFO: pip is looking at multiple versions of numpy to determine which version is compatible with other requirements. This could take a while.

在下所有的版本。

yihong0618 commented 5 months ago

为啥我们需要 numpy 啊我研究下。。

jacket230 commented 5 months ago

为啥我们需要 numpy 啊我研究下。。

我忘记执行: requrements了。先执行-r require,就不会有这个问题。

另外升级了3.9就可以了,不出现:TypeError: 'type' object is not subscriptable。 此前出现问题,3.8.1的python版本,建议升级3.9以上。 如果是win7可以参考: https://blog.csdn.net/weixin_45454897/article/details/129333857

yihong0618 commented 5 months ago

好的。

frostming commented 5 months ago

pip install bardapi==0.1.38

要退到 0.1.37才是好的