dsh-plugin-zhishe-common
文件与数据 活跃维护

dsh-plugin-zhishe-common

siweimofang/dsh-plugin-zhishe-common

封装知识库加载检索、基准价格查询、风险评估等通用能力,为知设DSH生态插件提供统一基础功能支撑,避免重复开发,保障各插件逻辑一致性,降低插件开发与维护成本。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
None
开源协议
7 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:siweimofang/dsh-plugin-zhishe-common
git clone https://github.com/siweimofang/dsh-plugin-zhishe-common.git
git clone git@github.com:siweimofang/dsh-plugin-zhishe-common.git
README.md master

zhishe-common

知设 DSH 插件共享基础设施包 — 为所有知设装修系列插件提供通用的知识库检索、基准价格索引和风险等级评估能力。

功能模块

模块 说明
knowledge.js 知识库加载 + 关键词检索 + 分词,支持数组/对象两种知识库格式
benchmark.js 基准价格库加载 + 关键词索引 + 条目匹配,覆盖 13 城装修分项基准价
risk.js 风险等级判定 + 风险分析,支持高/中/低三级风险输出

安装

npm install zhishe-common

使用

// 知识库检索
import { loadKnowledge, searchKnowledge } from 'zhishe-common/knowledge';

const kb = await loadKnowledge('./data/knowledge.json');
const results = await searchKnowledge(kb, '防水怎么做才不漏水?', { maxResults: 5 });

// 基准价格查询
import { loadBenchmark, buildKeywordIndex } from 'zhishe-common/benchmark';

const benchmark = await loadBenchmark('./data/benchmark.json');
const index = buildKeywordIndex(benchmark);

// 风险评估
import { riskLevel, analyzeRisks } from 'zhishe-common/risk';

const level = riskLevel('报价偏离超过50%');
const analysis = analyzeRisks(quoteItems);

被依赖的插件

License

MIT