Skip to content

Commit

Permalink
Feat/0.1.10 (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaojin3616 committed Nov 22, 2023
2 parents 457207b + 71e91ed commit ba92f21
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/backend/bisheng/api/v1/skillcenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 开始
Expand Down
6 changes: 3 additions & 3 deletions src/backend/bisheng/chat/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
isValidConnection,
nodeColors,
nodeIconsLucide,
nodeNames,
getNodeNames
} from "../../../../utils";
import DictComponent from "../../../../components/dictComponent";
import KeypairListComponent from "../../../../components/keypairListComponent";
Expand Down Expand Up @@ -152,7 +152,7 @@ export default function ParameterComponent({
/> */}
</div>
<span className="ps-2 text-xs text-foreground">
{nodeNames[item.family] ?? ""}{" "}
{getNodeNames()[item.family] ?? ""}{" "}
<span className="text-xs">
{" "}
{item.type === "" ? "" : " - "}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function DisclosureComponent({
<Disclosure as="div" key={title}>
{({ open }) => (
<>
<div>
<div className="min-w-[108px]">
<Disclosure.Button className="components-disclosure-arrangement">
<div className="flex gap-2">
<Icon strokeWidth={1.5} size={20} className="text-primary" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down Expand Up @@ -67,6 +67,7 @@ export default function ExtraSidebar({ flow }: { flow: FlowType }) {
}

const navgate = useNavigate()
const nodeNames = getNodeNames()
return (
<div className="side-bar-arrangement">
<div className="flex absolute right-[80px] top-4 z-10">
Expand Down
30 changes: 29 additions & 1 deletion src/frontend/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>) {
return classes.filter(Boolean).join(" ");
Expand Down Expand Up @@ -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",
Expand All @@ -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<SVGProps<SVGSVGElement>>
Expand Down

0 comments on commit ba92f21

Please sign in to comment.