-
对话交互实验室
- 支持多轮对话上下文保持
- 响应时间 <500ms
- 集成知识图谱检索
-
文本生成工坊
- 10+文学体裁模板
- 支持创意度调节(0.1-1.0)
- 最大生成长度1000token
-
法律咨询系统
- 覆盖1.2M+法律法规
- 条款引用准确率99.3%
- 合同风险点自动标注
-
情感分析平台
- 6维度情感分析
- 支持中英文混合文本
- 准确率92%
graph LR
A[前端界面] --> B[Flask服务]
B --> C[智谱AI接口]
B --> D[本地模型]
C --> E[对话引擎]
D --> F[文本生成]
style A fill:#4CAF50
style B fill:#2196F3
# 验证Node.js安装
node -v
# 需要v16+
# 验证Python安装
python --version
# 需要3.9+git clone https://github.com/your-repo/llm_learn.git
cd llm_learn
npm install
pip install -r requirements.txt
npm run dev# 构建镜像
docker build -t smartquest .
# 运行容器
docker run -p 5000:5000 -p 3000:3000 smartquest
# 开发模式
docker run -p 5000:5000 -p 3000:3000 -e FLASK_ENV=development smartquest- 安装Python 3.9
- 安装Node.js 16
- 下载项目代码
- 双击
install.bat完成依赖安装 - 修改
.env文件配置API密钥 - 双击
start.bat启动服务
# 前端热重载开发
npm run dev
# 后端调试模式
flask run --debug# 使用Docker开发模式
docker run -p 5000:5000 -p 3000:3000 -v $(pwd):/app -e FLASK_ENV=development smartquestasync function chat() {
const response = await fetch('/api/chat', {
method: 'POST',
body: JSON.stringify({
message: "如何学习Transformer?",
history: []
})
});
// 处理响应...
}| 参数 | 类型 | 说明 | 默认值 |
|---|---|---|---|
| temperature | float | 创意度 | 0.7 |
| top_p | float | 核采样 | 0.9 |
| max_length | int | 最大长度 | 500 |
POST /api/generate
{
"prompt": "写一首关于春天的诗",
"params": {
"temperature": 0.8,
"max_length": 300
}
}{
"status": "success",
"text": "春风拂面百花开...",
"usage": {
"prompt_tokens": 15,
"completion_tokens": 42
}
}# 运行所有测试
npm test
# 生成测试报告
npm run test:coveragedescribe('法律咨询模块', () => {
test('条款引用检查', () => {
const result = queryLaw("劳动合同纠纷");
expect(result).toContain("劳动法");
});
});- GPU使用率 <80%
- 内存占用 <16GB
- 请求成功率 >99%
# 查看错误日志
tail -f logs/error.log
# 性能监控
python monitor.pyQ: 依赖安装失败? A: 尝试切换镜像源:
npm config set registry https://registry.npmmirror.com
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simpleQ: 端口被占用?
A: 修改.env中的PORT配置
- Fork仓库
- 创建特性分支
- 提交Pull Request
- 通过CI测试
| 版本 | 日期 | 更新内容 |
|---|---|---|
| 1.1 | 2024-03-20 | 新增法律咨询模块 |
| 1.0 | 2024-03-15 | 项目初始版本发布 |