mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-19 12:10:17 +09:00
fix: baidu error_code 336006
This commit is contained in:
parent
764c0cb865
commit
d0e296adf8
@ -77,7 +77,8 @@ export class ErnieApi implements LLMApi {
|
||||
|
||||
async chat(options: ChatOptions) {
|
||||
const messages = options.messages.map((v) => ({
|
||||
role: v.role,
|
||||
// "error_code": 336006, "error_msg": "the role of message with odd index in the messages must be assistant",
|
||||
role: v.role === "system" ? "assistant" : v.role,
|
||||
content: getMessageTextContent(v),
|
||||
}));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user