feat: add article summary post-processing flow

This commit is contained in:
root
2026-03-28 00:08:38 +08:00
parent 3940db1443
commit 0a00a97724
7 changed files with 390 additions and 2 deletions
+42
View File
@@ -16,6 +16,11 @@ The server exposes four tools:
- `filter_summary_result`
- `run_freshrss_openclaw_pipeline`
Article-summary post-processing (separate LLM optional):
- `article-summary` MCP tool (operates on existing extracted payloads)
- `scripts/run_article_summaries.py` CLI helper
Validate an LLM summary result:
```bash
@@ -214,3 +219,40 @@ python scripts/apply_term_suggestions.py ^
```
Remove `--dry-run` to write the accepted changes. The script can also apply accepted `alias`, `stopword`, and `interest keyword` suggestions through `--accept-alias`, `--accept-stopword`, and `--accept-interest`. Accepted watch terms are written into `configs/term_watchlist.json`, and every applied action is appended into `configs/term_change_log.json`.
## Article-summary LLM configuration
Set a dedicated model for post-processing summaries without affecting the main pipeline:
- `ARTICLE_SUMMARY_LLM_API_URL`
- `ARTICLE_SUMMARY_LLM_MODEL`
- `ARTICLE_SUMMARY_LLM_API_KEY`
If these are not set, the summarizer falls back to the main `LLM_*` / `OPENAI_*` settings used elsewhere.
Example (PowerShell style):
```bash
set ARTICLE_SUMMARY_LLM_API_URL=https://api.deepseek.com
set ARTICLE_SUMMARY_LLM_API_KEY=your-article-summary-key
set ARTICLE_SUMMARY_LLM_MODEL=deepseek-chat
```
Then run, for example, either via the CLI script:
```bash
python scripts/run_article_summaries.py ^
--extracted outputs/freshrss/extracted/freshrss.extracted.json ^
--ids 12345 67890 ^
--output-dir outputs/freshrss/single_summaries
```
…or through the MCP server tool `generate_article_summaries` exposed by `summary_mcp.server`:
- `extracted_path` (string): path to the extracted JSON, for example `outputs/freshrss/extracted/freshrss.extracted.json`.
- `selected_ids` (array of strings): one or more `item_id` values from the extracted payload to summarize.
- `output_dir` (optional string): directory to write Markdown summaries. If omitted, summaries are written under `single_summaries/` next to the extracted file.
- `llm_api_key` / `llm_model` / `llm_api_url` (optional strings): overrides for article-summary LLM settings. If omitted, the tool falls back to `ARTICLE_SUMMARY_*` or main `LLM_*` env vars as described above.
The tool returns a JSON array of file paths for the generated Markdown summaries.