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

fastapi.exceptions.ResponseValidationError: 1 validation errors: #3

Closed
fengyunzaidushi opened this issue Jul 8, 2024 · 4 comments
Closed

Comments

@fengyunzaidushi
Copy link

fengyunzaidushi commented Jul 8, 2024

后端和前端正常启动,可以注册和登录;但是添加助手时间,报错如下:

INFO:app.auth.charrol_handlers:Authorization header: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjEwNTg3ODQsImlhdCI6MTcyMDQ1Mzk4NCwic3ViIjoiN2U1Y2UxODQtM2JmNy00NjgyLTk0NjctZTM2M2FmYjE2M2JjIn0.D7O0t5ZUbK65cMitIQEWURbOEiGBW7K5CAYpA571xic  
INFO:app.auth.charrol_handlers:Token decoded successfully: {'exp': 1721058784, 'iat': 1720453984, 'sub': '7e5ce184-3bf7-4682-9467-e363afb163bc'}
INFO:app.auth.charrol_handlers:Auth wrapper decoded user_id: 7e5ce184-3bf7-4682-9467-e363afb163bc
INFO:root:[获得助手] user_id:[7e5ce184-3bf7-4682-9467-e363afb163bc] assistant_id[dc6b04af-4e5c-4746-aaee-e4f8027e0a89]
INFO:     127.0.0.1:6447 - "GET /assistants/dc6b04af-4e5c-4746-aaee-e4f8027e0a89 HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "F:\miniconda3\envs\py1101\Lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 426, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\miniconda3\envs\py1101\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\miniconda3\envs\py1101\Lib\site-packages\fastapi\applications.py", line 292, in __call__
    await super().__call__(scope, receive, send)
  File "F:\miniconda3\envs\py1101\Lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "F:\miniconda3\envs\py1101\Lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "F:\miniconda3\envs\py1101\Lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "F:\miniconda3\envs\py1101\Lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "F:\miniconda3\envs\py1101\Lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "F:\miniconda3\envs\py1101\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in __call__
    raise e
  File "F:\miniconda3\envs\py1101\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "F:\miniconda3\envs\py1101\Lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "F:\miniconda3\envs\py1101\Lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "F:\miniconda3\envs\py1101\Lib\site-packages\starlette\routing.py", line 66, in app
    raise ResponseValidationError(
fastapi.exceptions.ResponseValidationError: 1 validation errors:
  {'type': 'dict_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary', 'input': <Record assistant_id='dc6b04af-4e5c-4746-aaee-e4f8027e0a89' user_id='7e5ce184-3bf7-4682-9467-e363afb163bc' name='111' config={'configurable': {'type': 'agent', 'type==agent/agent_type': '智谱清言GLM4', 'type==agent/interrupt_before_action': False, 'type==agent/retrieval_description': 'Can be used to look up information that was uploaded to this assistant.\nIf the user is referencing particular files, that is often a good hint that information may be here.\nIf the user asks a vague question, they are likely meaning to look up info from this retriever, and you should call it!', 'type==agent/system_message': '你是一个乐于助人的AI助手', 'type==agent/tools': [], 'type==chat_retrieval/llm_type': '智谱清言GLM4', 'type==chat_retrieval/system_message': '你是一个乐于助人的AI助手', 'type==chatbot/llm_type': '智谱清言GLM4', 'type==chatbot/system_message': '你是一个乐于助人的AI助手'}} updated_at=datetime.datetime(2024, 7, 8, 15, 57, 42, 666137, tzinfo=datetime.timezone.utc) public=False>, 'url': 'https://errors.pydantic.dev/2.8/v/dict_type'}

INFO:     127.0.0.1:6468 - "GET / HTTP/1.1" 404 Not Found
INFO:     127.0.0.1:6468 - "GET /favicon.ico HTTP/1.1" 404 Not Found
INFO:     127.0.0.1:6468 - "GET /docs HTTP/1.1" 200 OK
INFO:     127.0.0.1:6468 - "GET /openapi.json HTTP/1.1" 200 [OK]

环境是使用的poetry安装的,python3.11版本;
对应的参数和模型都下载好了。

附件是pyproject.toml和poetry.lock

backend_pyproject.toml_poetry.lock.zip

@susirial
Copy link
Owner

susirial commented Jul 9, 2024

Hi,
我看下这个问题~ 后面回复~
谢谢反馈~

BR

@susirial
Copy link
Owner

Hi ,
非常抱歉,让你久等了~
我上传了整个项目的 pip 安装包
https://github.com/susirial/Mojuan/blob/main/backend/requirements.txt

backend 可以通过 pip install -r requirements.txt 来安装了,希望能解决你的问题

BR

@fengyunzaidushi
Copy link
Author

非常感谢,重新安装,解决了!

@susirial
Copy link
Owner

多谢反馈!

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

No branches or pull requests

2 participants