跳转到主要内容

AI本地化实现

项目结构

ai.tihubb.com/
├─ server/   → Node API(代理 / Prompt 处理 / 鉴权 / 未来扩展)   
│   ├── package.json 
│   ├── index.js            ← HTTP API(/api/run)
│   ├── wp-client.js        ← 只负责和 WP 通信
│   ├── brief-publisher.js  ← 可选:业务层(生成 → 发布)
│   ├── tool-runner.js
│   ├── ollama.js           ← 只负责调 Ollama
│   ├── tools/
│   │   ├── brief.json      ← 简报内容
│   │   ├── brief.keywords.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'
  }
}