susirial / Mojuan

Mojuan: Write your own AI application.
https://www.chatroller.cn/
MIT License
13 stars 4 forks source link

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

Closed fengyunzaidushi closed 1 month ago

fengyunzaidushi commented 1 month ago

创建助手出现 INFO:app.auth.charrol_handlers:Authorization header: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjE4MTIwMTAsImlhdCI6MTcyMTIwNzIxMCwic3ViIjoiN2U1Y2UxODQtM2JmNy00NjgyLTk0NjctZTM2M2FmYjE2M2JjIn0.fKSP4O-DbOylROVZrbOLKdOD_p77wa2sQyhbjgYi_Pc INFO:app.auth.charrol_handlers:Token decoded successfully: {'exp': 1721812010, 'iat': 1721207210, '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[6ee7cee2-d3fd-42e3-bd9a-9e1ffb6cf4cb] INFO: 127.0.0.1:2969 - "GET /assistants/6ee7cee2-d3fd-42e3-bd9a-9e1ffb6cf4cb 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 response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "F:\miniconda3\envs\py1101\Lib\site-packages\fastapi\routing.py", line 291, in app content = await serialize_response( raise ResponseValidationError( fastapi.exceptions.ResponseValidationError: 1 validation errors: {'type': 'dict_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary', 'input': <Record assistant_id='6ee7cee2-d3fd-42e3-bd9a-9e1ffb6cf4cb' user_id='7e5ce184-3bf7-4682-9467-e363afb163bc' name='assistant1' 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, 17, 9, 7, 15, 590181, tzinfo=datetime.timezone.utc) public=False>, 'url': 'https://errors.pydantic.dev/2.8/v/dict_type'}

image 过了一会儿就会跳出登录: image

fengyunzaidushi commented 1 month ago

根据安装包,重新安装解决了! 如果出现 The conflict is caused by: The user requested httpx==0.27.0 anthropic 0.13.0 depends on httpx<1 and >=0.23.0 fireworks-ai 0.11.2 depends on httpx langserve 0.0.32 depends on httpx>=0.23.0 openai 1.10.0 depends on httpx<1 and >=0.23.0 zhipuai 2.1.2 depends on httpx>=0.23.0 opengpts 0.1.0 depends on httpx==0.25.2 可以把requirements.txt中httpx去掉,让代码自动安装。

另外如果出现: [AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?](https://stackoverflow.com/questions/77364550/attributeerror-module-pkgutil-has-no-attribute-impimporter-did-you-mean) 可能需要安装numpy==1.26.4

susirial commented 1 month ago

谢谢你的建议!