AI本地化实现
项目结构
ai.tihubb.com/
├─ server/ → Node API(代理 / Prompt 处理 / 鉴权 / 未来扩展)
│ ├── package.json
│ ├─ index.js ← HTTP API(/api/run)
│ ├── tool-runner.js
│ ├── ollama.js ← 只负责调 Ollama
│ ├── tools/
│ │ └── brief.json
│ └── prompts/
│ ├── brief.zhihu.md
│ ├── brief.x.md
│ └── brief.xhs.md
├── web/ → Vite + React 前端
│ ├── index.html
│ ├── package.json
│ ├── postcss.config.js
│ ├── tailwind.config.js
│ ├── vite.config.js
│ └── src/
│ ├── main.jsx
│ ├── App.jsx ← 只调 server API
│ └── index.css
└─ README.md
WP CPT字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| brief_question | Text | 原始问题 |
| brief_tone | Select | 干货 / 评论 / 建议 |
| brief_word_count | Number | 字数(生成后统计) |
Json格式
{
title: `【知乎简报】${question}`,
excerpt: summary,
content: briefContent,
status: 'draft',
fields: {
brief_platform: 'zhihu',
brief_question: question,
brief_tone: '干货',
brief_ai_source: 'local',
brief_model: 'qwen-7b',
brief_prompt_version: 'v1.2'
}
}