MCPcopy
hub / github.com/Zleap-AI/SAG / formatMessageRole

Function formatMessageRole

web/src/App.tsx:4040–4045  ·  view source on GitHub ↗
(role: string, t: (zh: string, en: string) => string)

Source from the content-addressed store, hash-verified

4038}
4039
4040function formatMessageRole(role: string, t: (zh: string, en: string) => string) {
4041 if (role === "user") return t("用户", "User");
4042 if (role === "assistant") return t("助手", "Assistant");
4043 if (role === "tool") return t("工具", "Tool");
4044 return t("系统", "System");
4045}
4046
4047function formatToolStatus(status: "PENDING" | "SUCCEEDED" | "FAILED", t: (zh: string, en: string) => string) {
4048 if (status === "SUCCEEDED") return t("成功", "Succeeded");

Callers 1

ConversationWorkspaceFunction · 0.85

Calls 1

tFunction · 0.85

Tested by

no test coverage detected