fix: mistral ai bug 400 role user after role tool (#2695)
This commit is contained in:
@@ -203,6 +203,10 @@ function M:parse_messages(opts)
|
||||
else
|
||||
table.insert(final_messages, { role = self.role_map["assistant"], content = "Ok, I understand." })
|
||||
end
|
||||
else
|
||||
if role == "user" and prev_role == "tool" and M.is_mistral(provider_conf.endpoint) then
|
||||
table.insert(final_messages, { role = self.role_map["assistant"], content = "Ok, I understand." })
|
||||
end
|
||||
end
|
||||
prev_role = role
|
||||
table.insert(final_messages, message)
|
||||
|
||||
Reference in New Issue
Block a user