Skip to content

Commit

Permalink
Resolved the issue where a 418 error was returned when the request me…
Browse files Browse the repository at this point in the history
…ssage contained a system role.
  • Loading branch information
yjmp14 committed Sep 12, 2024
1 parent b988a00 commit a2987e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conversion/requests/duckgo/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func buildContent(api_request *officialtypes.APIRequest) string {
for _, apiMessage := range api_request.Messages {
role := apiMessage.Role
if role == "user" || role == "system" || role == "assistant" {
if role == "system" {
role = "user"
}
contentStr := ""
// 判断 apiMessage.Content 是否为数组
if arrayContent, ok := apiMessage.Content.([]interface{}); ok {
Expand Down

0 comments on commit a2987e3

Please sign in to comment.