Skip to content

Commit

Permalink
pyd2
Browse files Browse the repository at this point in the history
  • Loading branch information
nek0us committed May 7, 2024
1 parent 3c9b5a4 commit 9897130
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,11 @@ SUPERUSERS=["qq num"]
当触发验证后,会在启动目录生成带有启动账号名称的文件,键入收到的验证码并保存,即可自动验证。留意日志输出提示

### 更新日志
2024.05.07 0.0.22
2024.05.07 0.0.23
1. 修复webssocket url未更新
2. 优化工作状态输出会话数遮蔽问题
3. 修复空数据时未正确重试的问题
4. 兼容pyd2


2024.05.06 0.0.20
Expand Down
15 changes: 4 additions & 11 deletions nonebot_plugin_gpt/config.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from pydantic import BaseModel, validator, root_validator
from pydantic import BaseModel, validator
from typing import List, Optional
from playwright._impl._api_structures import ProxySettings
from nonebot.log import logger
from nonebot import get_driver
from nonebot import get_driver,get_plugin_config

from .source import ban_str_path

class Config(BaseModel):
gpt_proxy: Optional[str] = None
pywt_proxy: Optional[ProxySettings] = None
arkose_status: bool = False
gpt_session: Optional[List[dict]]|str = []
group_chat: bool = True
Expand Down Expand Up @@ -52,12 +50,7 @@ def check_gpt_proxy(cls,v):
if isinstance(v,str):
logger.success(f"已应用 gpt_proxy 代理配置:{v}")
return v

@root_validator(pre=False)
def set_pywt_proxy(cls, values):
gpt_proxy = values.get('gpt_proxy')
values['pywt_proxy'] = {"server": gpt_proxy} if gpt_proxy else None
return values


@validator("arkose_status", always=True, pre=True)
def check_arkose_status(cls,v):
Expand Down Expand Up @@ -170,5 +163,5 @@ def check_gpt_httpx(cls,v):
logger.success(f"已关闭 gpt_httpx httpx使用")
return v

config_gpt = Config.parse_obj(get_driver().config)
config_gpt = get_plugin_config(Config)
config_nb = get_driver().config
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "nonebot-plugin-gpt"
version = "0.0.22"
version = "0.0.23"
description = "Nonebot2's plugin of ChatGPT "
authors = [
{name = "nek0us", email = "nekouss@mail.com"},
Expand Down

0 comments on commit 9897130

Please sign in to comment.