diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index aad5069..0eaec5f 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -31,6 +31,10 @@ type EditableAgent = { const DEFAULT_ENTRY_POINT = "fastapi_server/server_dashscope.py"; const DEFAULT_LLM_NAME = "qwen-plus"; const DEFAULT_PORT = 8100; +const GRAPH_ARCH_IMAGE_MODULES = import.meta.glob( + "../assets/images/graph_arch/*.{png,jpg,jpeg,webp,gif}", + { eager: true, import: "default" } +) as Record; const FALLBACK_PROMPTS_BY_GRAPH: Record> = { routing: { route_prompt: "", @@ -60,6 +64,18 @@ function parseToolCsv(value: string): string[] { return out; } +function getGraphArchImage(graphId: string): string | null { + const normalizedGraphId = graphId.trim().toLowerCase(); + for (const [path, source] of Object.entries(GRAPH_ARCH_IMAGE_MODULES)) { + const fileName = path.split("/").pop() || ""; + const baseName = fileName.split(".")[0]?.toLowerCase() || ""; + if (baseName === normalizedGraphId) { + return source; + } + } + return null; +} + function toEditable( config: GraphConfigReadResponse, draft: boolean @@ -432,6 +448,7 @@ export default function App() { isDraft: false, })), ]; + const graphArchImage = editor ? getGraphArchImage(editor.graphId) : null; return (
@@ -512,6 +529,19 @@ export default function App() { + {graphArchImage && ( +
+

Graph Architecture

+
+ {`${editor.graphId} +
+
+ )} +