Skip to content

Commit

Permalink
Merge branch 'fix-role-error'
Browse files Browse the repository at this point in the history
  • Loading branch information
HyiKi committed Aug 6, 2024
2 parents 7deb36e + d7e2ee6 commit 0902efc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/client/platforms/tencent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ export class HunyuanApi implements LLMApi {

async chat(options: ChatOptions) {
const visionModel = isVisionModel(options.config.model);
const messages = options.messages.map((v) => ({
role: v.role,
const messages = options.messages.map((v, index) => ({
// "Messages 中 system 角色必须位于列表的最开始"
role: index !== 0 && v.role === "system" ? "user" : v.role,
content: visionModel ? v.content : getMessageTextContent(v),
}));

Expand Down

0 comments on commit 0902efc

Please sign in to comment.