diff --git a/src/backend/bisheng/api/v1/skillcenter.py b/src/backend/bisheng/api/v1/skillcenter.py index 2005b272..a98ccc64 100644 --- a/src/backend/bisheng/api/v1/skillcenter.py +++ b/src/backend/bisheng/api/v1/skillcenter.py @@ -22,7 +22,7 @@ def create_template(*, session: Session = Depends(get_session), template: Templa # 校验name name_repeat = session.exec(select(Template).where(Template.name == db_template.name)).first() if name_repeat: - raise HTTPException(status_code=500, detail='模板名称重复,请重新检查') + raise HTTPException(status_code=500, detail='Repeat name, please choose another name') # 增加 order_num x,x+65535 max_order = session.exec(select(Template).order_by(Template.order_num.desc()).limit(1)).first() # 如果没有数据,就从 65535 开始 diff --git a/src/backend/bisheng/chat/manager.py b/src/backend/bisheng/chat/manager.py index 763de791..22ddfe76 100644 --- a/src/backend/bisheng/chat/manager.py +++ b/src/backend/bisheng/chat/manager.py @@ -210,7 +210,7 @@ async def process_file(self, client_id: str, chat_id: str, user_id: int, file_pa except Exception as e: logger.exception(e) step_resp = ChatResponse(type='end', - intermediate_steps='文件解析失败', + intermediate_steps='File is parsed fail', category='system', user_id=user_id) await self.send_json(client_id, chat_id, step_resp) @@ -228,7 +228,7 @@ async def process_file(self, client_id: str, chat_id: str, user_id: int, file_pa input = next((node for node in graph.nodes if node.vertex_type == 'InputNode'), None) if not input: step_resp = ChatResponse(type='end', - intermediate_steps='文件解析完成', + intermediate_steps='File parsing complete', category='system', user_id=user_id) await self.send_json(client_id, chat_id, step_resp) @@ -237,7 +237,7 @@ async def process_file(self, client_id: str, chat_id: str, user_id: int, file_pa return questions = input._built_object step_resp = ChatResponse(type='end', - intermediate_steps='文件解析完成,分析开始', + intermediate_steps='File parsing complete, analysis starting', category='system', user_id=user_id) await self.send_json(client_id, chat_id, step_resp) diff --git a/src/backend/pyproject.toml b/src/backend/pyproject.toml index 53685063..2cd08d93 100644 --- a/src/backend/pyproject.toml +++ b/src/backend/pyproject.toml @@ -19,7 +19,7 @@ bisheng = "bisheng.__main__:main" [tool.poetry.dependencies] bisheng_langchain = "v0.1.8" -bisheng_pyautogen = "0.1.14" +bisheng_pyautogen = "0.1.15" minio = "^7.1.16" fastapi_jwt_auth = "^0.5.0" redis = "^5.0.0" diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index fe9a04d6..73a3706c 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -26,7 +26,7 @@ import { isValidConnection, nodeColors, nodeIconsLucide, - nodeNames, + getNodeNames } from "../../../../utils"; import DictComponent from "../../../../components/dictComponent"; import KeypairListComponent from "../../../../components/keypairListComponent"; @@ -152,7 +152,7 @@ export default function ParameterComponent({ /> */} - {nodeNames[item.family] ?? ""}{" "} + {getNodeNames()[item.family] ?? ""}{" "} {" "} {item.type === "" ? "" : " - "} diff --git a/src/frontend/src/pages/FlowPage/components/DisclosureComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/DisclosureComponent/index.tsx index 3dcb7561..4727abd0 100644 --- a/src/frontend/src/pages/FlowPage/components/DisclosureComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/DisclosureComponent/index.tsx @@ -11,7 +11,7 @@ export default function DisclosureComponent({ {({ open }) => ( <> -
+
diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx index 1a31210f..adc4c486 100644 --- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx @@ -14,7 +14,7 @@ import L2ParamsModal from "../../../../modals/L2ParamsModal"; import ExportModal from "../../../../modals/exportModal"; import { APIClassType, APIObjectType } from "../../../../types/api"; import { FlowType } from "../../../../types/flow"; -import { classNames, nodeColors, nodeIconsLucide, nodeNames, } from "../../../../utils"; +import { classNames, nodeColors, nodeIconsLucide, getNodeNames, } from "../../../../utils"; import DisclosureComponent from "../DisclosureComponent"; export default function ExtraSidebar({ flow }: { flow: FlowType }) { @@ -67,6 +67,7 @@ export default function ExtraSidebar({ flow }: { flow: FlowType }) { } const navgate = useNavigate() + const nodeNames = getNodeNames() return (
diff --git a/src/frontend/src/utils.ts b/src/frontend/src/utils.ts index 229f45b3..4b3b6aea 100644 --- a/src/frontend/src/utils.ts +++ b/src/frontend/src/utils.ts @@ -52,6 +52,7 @@ import { SupabaseIcon } from "./icons/supabase"; import { APITemplateType } from "./types/api"; import { IVarHighlightType } from "./types/components"; import { FlowType, NodeType } from "./types/flow"; +import i18next from "i18next"; export function classNames(...classes: Array) { return classes.filter(Boolean).join(" "); @@ -135,7 +136,7 @@ export const nodeColors: { [char: string]: string } = { unknown: "#9CA3AF", }; -export const nodeNames: { [char: string]: string } = { +const nodeNames: { [char: string]: string } = { prompts: "提示词/Prompts", llms: "语言模型/LLMs", chains: "工作链/Chains", @@ -158,6 +159,33 @@ export const nodeNames: { [char: string]: string } = { unknown: "Unknown", }; +const nodeEnNames: { [char: string]: string } = { + prompts: "Prompts", + llms: "LLMs", + chains: "Chains", + agents: "Agents", + tools: "Tools", + memories: "Memories", + advanced: "Advanced", + chat: "Chat", + embeddings: "Embeddings", + documentloaders: "Loaders", + vectorstores: "VectorStores", + toolkits: "Toolkits", + wrappers: "Wrappers", + textsplitters: "TextSplitters", + retrievers: "Retrievers", + input_output: "input", + utilities: "Utilities", + output_parsers: "OutputParsers", + autogen_roles: 'AutogenRole', + unknown: "Unknown", +}; + +export function getNodeNames() { + return i18next.language === 'en' ? nodeEnNames : nodeNames +} + export const nodeIconsLucide: { [char: string]: React.ForwardRefExoticComponent< ComponentType>