XiaoXinYo / Chat-WebAPI

一款基于Python-FastAPI框架,开发的多种Chat WebAPI程序.
MIT License
57 stars 16 forks source link

[Bug]: bingAPI失效 #8

Open qq263424205 opened 1 year ago

qq263424205 commented 1 year ago

在提交前请确保以下这些

操作系统

Windows

Python版本

3.10.11

问题

文心一言是正常的,但是bingAPI失效

触发

{"code": 500, "message": "未知错误", "data": null}

报错

No response

其他

No response

XiaoXinYo commented 1 year ago

方便提供报错信息吗?

qq263424205 commented 1 year ago

D:\Chat-API-main>main.py INFO: Started server process [23076] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://192.168.2.64:5000 (Press CTRL+C to quit) INFO: 192.168.2.64:59816 - "GET /bing/ask?question=%E6%82%A8%E5%A5%BD HTTP/1.1" 200 OK ERROR: Exception in ASGI application Traceback (most recent call last): File "D:\python\lib\site-packages\anyio\streams\memory.py", line 98, in receive return self.receive_nowait() File "D:\python\lib\site-packages\anyio\streams\memory.py", line 93, in receive_nowait raise WouldBlock anyio.WouldBlock

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\python\lib\site-packages\starlette\middleware\base.py", line 78, in call_next message = await recv_stream.receive() File "D:\python\lib\site-packages\anyio\streams\memory.py", line 118, in receive raise EndOfStream anyio.EndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\python\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 428, in run_asgi result = await app( # type: ignore[func-returns-value] File "D:\python\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "D:\python\lib\site-packages\fastapi\applications.py", line 284, in call await super().call(scope, receive, send) File "D:\python\lib\site-packages\starlette\applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "D:\python\lib\site-packages\starlette\middleware\errors.py", line 184, in call raise exc File "D:\python\lib\site-packages\starlette\middleware\errors.py", line 162, in call await self.app(scope, receive, _send) File "D:\python\lib\site-packages\starlette\middleware\base.py", line 108, in call response = await self.dispatch_func(request, call_next) File "D:\Chat-API-main\main.py", line 56, in middleware response = await call_next(request) File "D:\python\lib\site-packages\starlette\middleware\base.py", line 84, in call_next raise app_exc File "D:\python\lib\site-packages\starlette\middleware\base.py", line 70, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "D:\python\lib\site-packages\starlette\middleware\cors.py", line 83, in call await self.app(scope, receive, send) File "D:\python\lib\site-packages\starlette\middleware\exceptions.py", line 79, in call raise exc File "D:\python\lib\site-packages\starlette\middleware\exceptions.py", line 68, in call await self.app(scope, receive, sender) File "D:\python\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in call raise e File "D:\python\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in call await self.app(scope, receive, send) File "D:\python\lib\site-packages\starlette\routing.py", line 718, in call await route.handle(scope, receive, send) File "D:\python\lib\site-packages\starlette\routing.py", line 276, in handle await self.app(scope, receive, send) File "D:\python\lib\site-packages\starlette\routing.py", line 66, in app response = await func(request) File "D:\Chat-API-main\view\bing.py", line 103, in ask data = await chatBot.ask(question, conversation_style=getStyleEnum(style), webpage_context=getPrompt(prompt)) File "D:\python\lib\site-packages\EdgeGPT\EdgeGPT.py", line 116, in ask async for final, response in self.chat_hub.ask_stream( File "D:\python\lib\site-packages\EdgeGPT\chathub.py", line 102, in ask_stream async with connect( File "D:\python\lib\site-packages\websockets\legacy\client.py", line 637, in aenter return await self File "D:\python\lib\site-packages\websockets\legacy\client.py", line 655, in await_impl_timeout return await self.await_impl() File "D:\python\lib\site-packages\websockets\legacy\client.py", line 662, in await_impl await protocol.handshake( File "D:\python\lib\site-packages\websockets\legacy\client.py", line 329, in handshake raise InvalidStatusCode(status_code, response_headers) websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 200 INFO: 192.168.2.64:59821 - "GET /favicon.ico HTTP/1.1" 200 OK

qq263424205 commented 1 year ago

@XiaoXinYo

XiaoXinYo commented 1 year ago

参考 acheong08/EdgeGPT#584

qq263424205 commented 1 year ago

@XiaoXinYo 不是代码问题?

XiaoXinYo commented 1 year ago
d9135230968c6644863539f09dfe62d

应该是这样的,我直接调用EdgeGPT也无法使用

qq263424205 commented 1 year ago

@XiaoXinYo 那需要怎么解决?

XiaoXinYo commented 1 year ago

clash tun模式可能会有效,,