一个基于 LangChain 的模组内容翻译与搜索系统,支持模组的双语翻译(中英)和自然语言搜索功能,以及Markdown内容的格式化。 并且提供AI搜索pg数据库的支持,提供模组的智能搜索功能。
- 🌐 双语翻译:自动将模组标题和内容翻译为中文和英文,支持 Markdown 格式优化。
- 🔍 AI 搜索:通过自然语言处理,将用户查询转化为 SQL,实现模组智能搜索。
- ⚡ 高性能:多线程翻译与快速响应 API。
- 🛡️ 安全性:检测并阻止 SQL 注入攻击。
- 🛡️ 护栏:检测并忽略跑题聊天。
AI搜索 服务端
- Python - LangChain 结构化 数据处理
- FastAPI - 高性能 API 框架
- PostgreSQL - 数据存储
AI 批处理翻译
- Python - LangChain 翻译脚本
- DigitalOcean - llama 3.3 模型 (批处理翻译)
- xAI - Grok2.0 模型 (批处理翻译)
.
├── translate.py # AI翻译批处理脚本
├── ai_search.py # Fastapi 服务入口
├── config.py # 配置文件
└── requirements.txt # Python 依赖
- Python 3.8+
- PostgreSQL
# 安装 Python 依赖
pip install -r requirements.txt
# 启动服务端(默认端口 5027)
python ai_search.py
# 默认启用了CORS
欢迎提交 Issue 或 Pull Request:
- Fork 项目
- 创建分支 (
git checkout -b feature/NewFeature
) - 提交更改 (
git commit -m 'Add NewFeature'
) - 推送分支 (
git push origin feature/NewFeature
) - 创建 Pull Request
基于 MIT 许可证开源,详见 LICENSE 文件。
(返回顶部)