MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / generate_generic_draft

Function generate_generic_draft

scripts/generate_content_pr.py:261–313  ·  view source on GitHub ↗

Generate a generic EN and ZH draft for any update type.

(update: dict)

Source from the content-addressed store, hash-verified

259
260
261def generate_generic_draft(update: dict) -> tuple[str, str]:
262 """Generate a generic EN and ZH draft for any update type."""
263 name = update.get("name", "Unknown Source")
264 url = update.get("url", "")
265 category = update.get("category", "unknown")
266 detected_at = update.get("detected_at", datetime.now().isoformat())[:10]
267 note = update.get("note", "")
268
269 en_content = f"""---
270title: Regulatory Update - {name} ({detected_at})
271draft: true
272source: {url}
273category: {category}
274detected_at: {detected_at}
275---
276
277# Regulatory Update: {name}
278
279> **Draft**: Auto-generated from update detection. Requires human review before merging.
280
281**Category**: `{category}`
282**Source**: [{name}]({url})
283**Detected**: {detected_at}
284**Note**: {note}
285
286::: warning Review Required
287This draft was auto-generated. Please review the source URL and update
288the relevant documentation pages before merging.
289:::
290"""
291
292 zh_content = f"""---
293title: 法规更新 - {name} ({detected_at})
294draft: true
295source: {url}
296category: {category}
297detected_at: {detected_at}
298---
299
300# 法规更新:{name}
301
302> **草稿**:自动生成,合并前需人工审核。
303
304**类别**:`{category}`
305**来源**:[{name}]({url})
306**检测时间**:{detected_at}
307**说明**:{note}
308
309::: warning 需要审核
310此草稿为自动生成。请审核来源 URL 并在合并前更新相关文档页面。
311:::
312"""
313 return en_content, zh_content
314
315
316# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected