Fix two bugs in Minimax's model worker that affect usage, namely do_ Embeddings should return result for multiple documents, and the other option is validate_ Messages, 'role': 'user' should be the uppercase letter 'USER'

This commit is contained in:
xieyh 2024-01-13 15:44:26 +08:00 committed by GitHub
parent 0a37fe93b8
commit ebda1056e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@ class MiniMaxWorker(ApiModelWorker):
def validate_messages(self, messages: List[Dict]) -> List[Dict]:
role_maps = {
"user": self.user_role,
"USER": self.user_role,
"assistant": self.ai_role,
"system": "system",
}
@ -140,7 +140,7 @@ class MiniMaxWorker(ApiModelWorker):
self.logger.error(f"请求 MiniMax API 时发生错误:{data}")
return data
i += batch_size
return {"code": 200, "data": embeddings}
return {"code": 200, "data": result}
def get_embeddings(self, params):
# TODO: 支持embeddings