chatchat-space / Langchain-Chatchat

Langchain-Chatchat(原Langchain-ChatGLM, Qwen 与 Llama 等)基于 Langchain 与 ChatGLM 等语言模型的 RAG 与 Agent 应用 | Langchain-Chatchat (formerly langchain-ChatGLM), local knowledge based LLM (like ChatGLM, Qwen and Llama) RAG and Agent app with langchain
Apache License 2.0
29.71k stars 5.21k forks source link

启动成功了,但是请求api 的文档返回的是如下信息 #3153

Closed griftt closed 2 months ago

griftt commented 4 months ago

启动成功了,但是请求api文档页面返回了如下的错误信息:Invalid request url: /docs,补充一下,我访问web-ui是能正常打开的

dosubot[bot] commented 4 months ago

Based on a similar issue found in the Langchain-Chatchat repository, it seems that the error message "Invalid request url: /docs" might be related to the local network environment. You can check your network environment and update to the latest code to see if the issue persists. If it does, you can consider reopening the issue for further assistance. Here is the link to the similar issue: 启动api服务以后出现Invalid request url: /docs.

However, another possible reason for this error could be due to the FastAPI application being configured to run in an offline mode, which disables the automatic generation of the documentation pages (Swagger UI and ReDoc). This is done by the MakeFastAPIOffline(app) function call in the create_app function in the server/api.py file.

To resolve this, you could either remove or comment out the MakeFastAPIOffline(app) call in the create_app function, or modify the MakeFastAPIOffline function's implementation to not disable the documentation endpoints. This would depend on your application's requirements and the behavior of the MakeFastAPIOffline function. Here is the link to the relevant code: server/api.py.

Unfortunately, I wasn't able to find the exact function of MakeFastAPIOffline(app) in the server/api.py file within the repository. It might be beneficial to look into this function further to understand its exact behavior and how it might be affecting the availability of the documentation endpoints.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
loveHao commented 4 months ago

我也遇到一样的问题

302658980 commented 4 months ago

我也是 报错是 GET http://region-9.autodl.pro:43612/static-offline-docs/swagger-ui.css net::ERR_ABORTED 404 (Not Found) docs:12 GET http://region-9.autodl.pro:43612/static-offline-docs/swagger-ui-bundle.js net::ERR_ABORTED 404 (Not Found) docs:15 Uncaught ReferenceError: SwaggerUIBundle is not defined 看起来是找不到css js

New-King commented 4 months ago

我也遇到这个问题了,请问你解决了吗?我使用dsw部署的,webui也是正常,但是 Chatchat API Server: http://127.0.0.1:7861 点进去就是Invalid request url: /docs ,没有报错,响应就是这几个字符串

chenxin03 commented 3 months ago

我也遇到这个问题了,请问你解决了吗?我使用dsw部署的,webui也是正常,但是 Chatchat API Server: http://127.0.0.1:7861 点进去就是Invalid request url: /docs ,没有报错,响应就是这几个字符串

一样 请问有找到解决方案吗

如果是dsw部署可以试试我的解决办法 https://github.com/chatchat-space/Langchain-Chatchat/issues/3435#issuecomment-2008618078

New-King commented 3 months ago

我也遇到这个问题了,请问你解决了吗?我使用dsw部署的,webui也是正常,但是 Chatchat API Server: http://127.0.0.1:7861 点进去就是Invalid request url: /docs ,没有报错,响应就是这几个字符串

一样 请问有找到解决方案吗

如果是dsw部署可以试试我的解决办法 #3435 (comment)

👍👍👍