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]: ValueError: Tag "<head>" does not correspond to any known ansi directive, make sure you did not misspelled it (or prepend '\' to escape it) #102

Open
4 tasks done
damasknull opened this issue Jan 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@damasknull
Copy link

报告清单

  • 我已仔细阅读并了解上述注意事项。
  • 我已使用最新版本测试过,确认问题依旧存在。
  • 我确定在 GitHub Issues 中没有相同或相似的问题。
  • 我有足够的时间和能力,愿意为此提交 PR 来修复问题。

影响版本

v0.7.3

问题描述

通过nb命令下载并配置完成后运行出现错误

复现步骤

向机器人发送请求 报错

预期行为

正常运行

实际行为

ValueError: Tag "" does not correspond to any known ansi directive, make sure you did not misspelled it (or prepend '' to escape it)

日志信息

01-23 03:33:29 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_chatgpt) failed.
Traceback (most recent call last):
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 97, in refresh_session
self.authorization = response.json()["accessToken"]
File "D:\soft\nonebot\chat.venv\lib\site-packages\httpx_models.py", line 756, in json
return jsonlib.loads(self.text, **kwargs)
File "C:\Users\30765\anaconda3\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\30765\anaconda3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\30765\anaconda3\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 17, in
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run
uvicorn.run(
File "D:\soft\nonebot\chat.venv\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "D:\soft\nonebot\chat.venv\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\30765\anaconda3\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\30765\anaconda3\lib\asyncio\base_events.py", line 634, in run_until_complete
self.run_forever()
File "C:\Users\30765\anaconda3\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\30765\anaconda3\lib\asyncio\base_events.py", line 601, in run_forever
self._run_once()
File "C:\Users\30765\anaconda3\lib\asyncio\base_events.py", line 1905, in _run_once
handle._run()
File "C:\Users\30765\anaconda3\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot\message.py", line 187, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 732, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 707, in simple_run
await handler(
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot_plugin_chatgpt_init_.py", line 55, in ai_chat
msg = await chat_bot(**session[session_id]).get_chat_response(text)
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 61, in get_chat_response
await self.refresh_session()
File "D:\soft\nonebot\chat.venv\lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 99, in refresh_session
logger.opt(colors=True, exception=e).error(
File "D:\soft\nonebot\chat.venv\lib\site-packages\loguru_colorizer.py", line 369, in prepare_simple_message
parser.feed(string)
File "D:\soft\nonebot\chat.venv\lib\site-packages\loguru_colorizer.py", line 253, in feed
raise ValueError(
ValueError: Tag "" does not correspond to any known ansi directive, make sure you did not misspelled it (or prepend '' to escape it)

额外补充

No response

@damasknull damasknull added the bug Something isn't working label Jan 22, 2023
@zhangbobo123
Copy link

我也是这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants