From 73aa53f536607db4aed5f7300bd6a0125a23c620 Mon Sep 17 00:00:00 2001 From: JustSong Date: Sat, 13 May 2023 12:24:49 +0800 Subject: [PATCH] fix: remove the dot in model name (#57) --- README.md | 2 +- controller/relay.go | 1 + web/src/pages/Channel/EditChannel.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 513b2f66..6776dff3 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ _✨ All in one 的 OpenAI 接口,整合各种 API 访问方式,开箱即用 1. 支持多种 API 访问渠道,欢迎 PR 或提 issue 添加更多渠道: + [x] OpenAI 官方通道 + [x] [API2D](https://api2d.com/r/197971) - + [ ] Azure OpenAI API + + [x] Azure OpenAI API + [x] [CloseAI](https://console.openai-asia.com) + [x] [OpenAI-SB](https://openai-sb.com) + [x] [OpenAI Max](https://openaimax.com) diff --git a/controller/relay.go b/controller/relay.go index 1767423c..90285222 100644 --- a/controller/relay.go +++ b/controller/relay.go @@ -100,6 +100,7 @@ func relayHelper(c *gin.Context) error { baseURL = c.GetString("base_url") task := strings.TrimPrefix(requestURL, "/v1/") model_ := textRequest.Model + model_ = strings.Replace(model_, ".", "", -1) fullRequestURL = fmt.Sprintf("%s/openai/deployments/%s/%s", baseURL, model_, task) } req, err := http.NewRequest(c.Request.Method, fullRequestURL, c.Request.Body) diff --git a/web/src/pages/Channel/EditChannel.js b/web/src/pages/Channel/EditChannel.js index ed5384e2..fdb078e5 100644 --- a/web/src/pages/Channel/EditChannel.js +++ b/web/src/pages/Channel/EditChannel.js @@ -80,7 +80,7 @@ const EditChannel = () => { inputs.type === 3 && ( <> - 注意,创建资源时,部署名称必须和 OpenAI 官方的模型名称保持一致,因为 One API 会把请求体中的 model 参数替换为你的部署名称。 + 注意,创建资源时,部署名称必须模型名称保持一致,因为 One API 会把请求体中的 model 参数替换为你的部署名称(模型名称中的点会被剔除)。