From 29fa94e7d28140f42bf49d95268f3c12f7c6a0ea Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Fri, 11 Aug 2023 19:27:42 +0800 Subject: [PATCH 1/2] docs: update FastGPT's description (#388) --- README.en.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.en.md b/README.en.md index 2ea6e65e..92eb567f 100644 --- a/README.en.md +++ b/README.en.md @@ -283,7 +283,7 @@ If the channel ID is not provided, load balancing will be used to distribute the + Double-check that your interface address and API Key are correct. ## Related Projects -[FastGPT](https://github.com/c121914yu/FastGPT): Build an AI knowledge base in three minutes +[FastGPT](https://github.com/labring/FastGPT): Knowledge question answering system based on the LLM ## Note This project is an open-source project. Please use it in compliance with OpenAI's [Terms of Use](https://openai.com/policies/terms-of-use) and **applicable laws and regulations**. It must not be used for illegal purposes. diff --git a/README.md b/README.md index ad90bb15..9840fa19 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ https://openai.justsong.cn + 上游通道 429 了。 ## 相关项目 -[FastGPT](https://github.com/c121914yu/FastGPT): 三分钟搭建 AI 知识库 +[FastGPT](https://github.com/labring/FastGPT): 基于 LLM 大语言模型的知识库问答系统 ## 注意 From 3b36608bbd47eadcd581e264a430290a287143c4 Mon Sep 17 00:00:00 2001 From: JustSong Date: Fri, 11 Aug 2023 19:53:01 +0800 Subject: [PATCH 2/2] fix: update no route handler --- controller/relay.go | 6 +++--- router/web-router.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controller/relay.go b/controller/relay.go index dee9c94d..617e22b8 100644 --- a/controller/relay.go +++ b/controller/relay.go @@ -207,10 +207,10 @@ func RelayNotImplemented(c *gin.Context) { func RelayNotFound(c *gin.Context) { err := OpenAIError{ - Message: fmt.Sprintf("API not found: %s:%s", c.Request.Method, c.Request.URL.Path), - Type: "one_api_error", + Message: fmt.Sprintf("Invalid URL (%s %s)", c.Request.Method, c.Request.URL.Path), + Type: "invalid_request_error", Param: "", - Code: "api_not_found", + Code: "", } c.JSON(http.StatusNotFound, gin.H{ "error": err, diff --git a/router/web-router.go b/router/web-router.go index 19fc0c04..8f9c18a2 100644 --- a/router/web-router.go +++ b/router/web-router.go @@ -18,7 +18,7 @@ func SetWebRouter(router *gin.Engine, buildFS embed.FS, indexPage []byte) { router.Use(middleware.Cache()) router.Use(static.Serve("/", common.EmbedFolder(buildFS, "web/build"))) router.NoRoute(func(c *gin.Context) { - if strings.HasPrefix(c.Request.RequestURI, "/v1") { + if strings.HasPrefix(c.Request.RequestURI, "/v1") || strings.HasPrefix(c.Request.RequestURI, "/api") { controller.RelayNotFound(c) return }