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]:python3.9中typing库的 | 操作符不支持 #895

Closed
setwhite opened this issue Oct 7, 2024 · 1 comment
Closed

[Bug]:python3.9中typing库的 | 操作符不支持 #895

setwhite opened this issue Oct 7, 2024 · 1 comment
Labels
bug? Bug或Bug修复相关

Comments

@setwhite
Copy link

setwhite commented Oct 7, 2024

消息平台适配器

Nakuru(go-cqhttp)

运行环境

Ubuntu python3.9.12

QChatGPT版本

v3.3.1

异常情况

python3.9,typing库的 | 操作符不支持
报错TypeError: unsupported operand type(s) for |: '_UnionGenericAlias' and '_UnionGenericAlias'

QChatGPT-3.3.1.1/pkg/provider/entities.py中:
content: typing.Optional[list[ContentElement]] | typing.Optional[str] = None

QChatGPT-3.3.1.1/pkg/core/entities.py中:
resp_messages: typing.Optional[list[llm_entities.Message]] | typing.Optional[list[mirai.MessageChain]] = []

用typing.Union改写后正常运行

启用的插件

No response

@setwhite setwhite added the bug? Bug或Bug修复相关 label Oct 7, 2024
@setwhite setwhite changed the title [Bug]: [Bug]:python3.9中typing库的 | 操作符不支持 Oct 7, 2024
@RockChinQ
Copy link
Owner

现在不支持3.9了,最低要求python 3.10.1。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? Bug或Bug修复相关
Projects
None yet
Development

No branches or pull requests

2 participants