CleanFrame
A personal home screen for Samsung The Frame. A starting point to fork and adapt.
AI 命理 Demo · 八字排盘 + 大模型解读
Translation pending
LifestyleGitHub @echozmecin-commitsOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Repository information has not been collected yet.
No updates detected yet. GitHub releases will appear here.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗一个单页 AI 产品 Demo:用户输入公历出生日期、时辰和性别,页面用 lunar-javascript 在本地排八字、算五行和运势曲线,并生成事业、感情、财运、健康四类解读。配置 API Key 后,再调用大模型生成一段综合解读;没有 Key、超时或接口报错时,保留本地解读并显示降级原因。
它想演示的不是“算命准不准”,而是一个 AI 产品的可靠落地方式:确定性计算在前,生成式 AI 在后,失败可降级,边界可解释。
| 能力 | 说明 |
|---|---|
| 本地排盘 | 公历日期 + 时辰 + 性别 → 四柱、五行、纳音、大运、流年 |
| 可视化 | 人生运势曲线、五行分布条形图、逐年数据表 |
| 本地解读 | 事业、感情、财运、健康四类模板解读,不依赖网络 |
| 可选 AI | 支持 Bearer 鉴权的 OpenAI Chat Completions 兼容接口,默认 DeepSeek |
| 降级机制 | 无 Key、20 秒超时、HTTP 错误、空响应都回退到本地模板 |
| 隐私控制 | Key 只存本机 localStorage,页面提供“清除 Key”;请求时才会发送到你填写的接口 |
flowchart LR
A[出生日期 / 时辰 / 性别] --> B[lunar-javascript 本地排盘]
B --> C[四柱 · 五行 · 大运 · 流年]
C --> D[本地模板解读]
D --> E{配置了 API Key?}
E -- 否 / 超时 / 报错 --> F[保留本地解读 + 降级提示]
E -- 是 --> G[调用 OpenAI 兼容接口]
G --> H[AI 综合解读]
H --> I[替换展示 + 免责声明]
不需要构建工具,直接打开即可:
# 方式一:直接打开
open index.html
# 方式二:起静态服务器(推荐,AI 模式对 file:// 更友好)
python3 -m http.server 8080
# 打开 http://localhost:8080
不配置 Key 也能完整走完排盘和本地解读。要体验 AI:
https://api.deepseek.com)、API Key、模型(默认 deepseek-chat);浏览器直连要求服务商允许 CORS。DeepSeek 已实测可用;部分服务商(例如 OpenAI 官方 API)不允许浏览器直连,需要自建代理。
.
├── index.html # 页面、样式、排盘、图表、AI 客户端
├── lunar.js # 本地化的 lunar-javascript 依赖
├── docs/images/cover.svg # README 封面
├── LICENSE # MIT
└── THIRD_PARTY_NOTICES.md # lunar-javascript attribution
styles.css、app.js 和排盘/图表/AI 模块代码使用 MIT License。lunar.js 来自 6tail/lunar-javascript,同样为 MIT,详见 THIRD_PARTY_NOTICES.md。