Skip to content

Commit

Permalink
Merge pull request #30 from yjmp14/main
Browse files Browse the repository at this point in the history
Resolved the issue where a 418 error was returned when the request message contained a system role.
  • Loading branch information
xiaozhou26 authored Sep 13, 2024
2 parents b988a00 + a2987e3 commit 4704603
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

2 comments on commit 4704603

@hhhaiai
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样确定可以生效么

@xiaozhou26
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看反应是可以的

Please sign in to comment.