mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	fix: baidu error_code 336006
This commit is contained in:
		@@ -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),
 | 
			
		||||
    }));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user