Merge pull request #29 from xqdoo00o/test
This commit is contained in:
commit
64689873d0
@ -142,6 +142,9 @@ func nightmare(c *gin.Context) {
|
||||
if original_response.Error != nil {
|
||||
return
|
||||
}
|
||||
if original_response.Message.Content.Parts == nil {
|
||||
continue
|
||||
}
|
||||
if original_response.Message.Content.Parts[0] == "" || original_response.Message.Author.Role != "assistant" {
|
||||
continue
|
||||
}
|
||||
|
@ -2,10 +2,17 @@ package chatgpt
|
||||
|
||||
import (
|
||||
typings "freechatgpt/internal/typings"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ConvertAPIRequest(api_request typings.APIRequest) ChatGPTRequest {
|
||||
chatgpt_request := NewChatGPTRequest()
|
||||
if strings.HasPrefix(api_request.Model, "gpt-4") {
|
||||
chatgpt_request.Model = "gpt-4"
|
||||
if api_request.Model == "gpt-4-browsing" {
|
||||
chatgpt_request.Model = "gpt-4-browsing"
|
||||
}
|
||||
}
|
||||
for _, api_message := range api_request.Messages {
|
||||
if api_message.Role == "system" {
|
||||
api_message.Role = "critic"
|
||||
|
Reference in New Issue
Block a user