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

Function generate_nmpa_draft

scripts/generate_content_pr.py:207–258  ·  view source on GitHub ↗

Generate EN and ZH draft Markdown for NMPA/CMDE updates.

(update: dict)

Source from the content-addressed store, hash-verified

205
206
207def generate_nmpa_draft(update: dict) -> tuple[str, str]:
208 """Generate EN and ZH draft Markdown for NMPA/CMDE updates."""
209 name = update.get("name", "Unknown Source")
210 url = update.get("url", "")
211 detected_at = update.get("detected_at", datetime.now().isoformat())[:10]
212
213 en_content = f"""---
214title: NMPA/CMDE Updates ({detected_at})
215draft: true
216source: {url}
217detected_at: {detected_at}
218---
219
220# NMPA/CMDE Regulatory Updates
221
222> **Draft**: Auto-generated from update detection. Requires human review before merging.
223
224Potential updates detected from [{name}]({url}).
225
226::: tip Source
227[CMDE Guidance Principles](https://www.cmde.org.cn/flfg/zdyz/)
228:::
229
230::: warning Review Required
231This draft was auto-generated. Please manually check the source URL for new
232guidance principles and update `docs/en/nmpa/guidance.md` accordingly.
233:::
234"""
235
236 zh_content = f"""---
237title: NMPA/CMDE 更新 ({detected_at})
238draft: true
239source: {url}
240detected_at: {detected_at}
241---
242
243# NMPA/CMDE 法规更新
244
245> **草稿**:自动生成,合并前需人工审核。
246
247从 [{name}]({url}) 检测到潜在更新。
248
249::: tip 来源
250[CMDE 指导原则](https://www.cmde.org.cn/flfg/zdyz/)
251:::
252
253::: warning 需要审核
254此草稿为自动生成。请手动检查来源 URL 中的新指导原则,
255并相应更新 `docs/zh/nmpa/guidance.md`。
256:::
257"""
258 return en_content, zh_content
259
260
261def generate_generic_draft(update: dict) -> tuple[str, str]:

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected