fix: let user to define api path for chatgptweb

This commit is contained in:
ckt1031 2023-07-15 22:14:42 +08:00
parent f5f21dffd8
commit 5b8a826cf9
2 changed files with 0 additions and 3 deletions

View File

@ -32,7 +32,6 @@ func testChannel(channel *model.Channel, request ChatRequest) error {
if channel.BaseURL != "" { if channel.BaseURL != "" {
requestURL = channel.BaseURL requestURL = channel.BaseURL
} }
requestURL += "/api/chat-process"
} else { } else {
if channel.BaseURL != "" { if channel.BaseURL != "" {
requestURL = channel.BaseURL requestURL = channel.BaseURL

View File

@ -121,8 +121,6 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
} else if channelType == common.ChannelTypeChatGPTWeb { } else if channelType == common.ChannelTypeChatGPTWeb {
// remove /v1/chat/completions from request url // remove /v1/chat/completions from request url
requestURL := strings.Split(requestURL, "/v1/chat/completions")[0] requestURL := strings.Split(requestURL, "/v1/chat/completions")[0]
requestURL += "/api/chat-process"
fullRequestURL = fmt.Sprintf("%s%s", baseURL, requestURL) fullRequestURL = fmt.Sprintf("%s%s", baseURL, requestURL)
} else if channelType == common.ChannelTypePaLM { } else if channelType == common.ChannelTypePaLM {
err := relayPaLM(textRequest, c) err := relayPaLM(textRequest, c)