Skip to content

Commit

Permalink
fix naming conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Parker-Stafford committed Oct 8, 2024
1 parent 27e6101 commit 467c5fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/src/pages/playground/__tests__/playgroundUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ describe("getChatRole", () => {

it("should return the ChatMessageRole if the role is included in ChatRoleMap", () => {
expect(getChatRole("assistant")).toEqual("ai");
expect(getChatRole("bot")).toEqual("ai");
expect(getChatRole("system")).toEqual("system");
expect(getChatRole("human:")).toEqual("user");
// expect(getChatRole("bot")).toEqual("ai");
// expect(getChatRole("system")).toEqual("system");
// expect(getChatRole("human:")).toEqual("user");
});

it("should return DEFAULT_CHAT_ROLE if the role is not found", () => {
Expand Down
4 changes: 2 additions & 2 deletions app/src/pages/playground/playgroundUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export function getChatRole(role: string): ChatMessageRole {
return role;
}

for (const [role, acceptedValues] of Object.entries(ChatRoleMap)) {
for (const [chatRole, acceptedValues] of Object.entries(ChatRoleMap)) {
if (acceptedValues.includes(role)) {
return role as ChatMessageRole;
return chatRole as ChatMessageRole;
}
}
return DEFAULT_CHAT_ROLE;
Expand Down

0 comments on commit 467c5fa

Please sign in to comment.