chore: import upstream snapshot with attribution
Ruff Format Check / Ruff Format & Lint (push) Failing after 7m39s
Deploy VitePress site to Pages / build (push) Failing after 9m11s
Deploy VitePress site to Pages / Deploy (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 12:32:26 +08:00
commit 1443d3fdf9
732 changed files with 196602 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
import { apiGet } from './base'
export const graphApi = {
getGraphs: async () => {
return await apiGet('/api/graph/list', {}, true)
},
getSubgraph: async (params) => {
const {
kb_id,
node_label = '*',
max_depth = 2,
max_nodes = 100,
exclude_chunk = false
} = params
if (!kb_id) {
throw new Error('kb_id is required')
}
const queryParams = new URLSearchParams({
kb_id,
node_label,
max_depth: max_depth.toString(),
max_nodes: max_nodes.toString(),
exclude_chunk: exclude_chunk.toString()
})
return await apiGet(`/api/graph/subgraph?${queryParams.toString()}`, {}, true)
},
getStats: async (kb_id) => {
if (!kb_id) {
throw new Error('kb_id is required')
}
const queryParams = new URLSearchParams({ kb_id })
return await apiGet(`/api/graph/stats?${queryParams.toString()}`, {}, true)
},
getLabels: async (kb_id) => {
if (!kb_id) {
throw new Error('kb_id is required')
}
const queryParams = new URLSearchParams({ kb_id })
return await apiGet(`/api/graph/labels?${queryParams.toString()}`, {}, true)
}
}
export const unifiedApi = graphApi