MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / extractExample

Function extractExample

apps/webuiapps/src/lib/cardExtractor.ts:449–461  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

447}
448
449function extractExample(content: string): string {
450 const markers = ['生成示例:\n', '生成示例:\n', '总格式示例:\n', '总格式示例:\n'];
451 for (const marker of markers) {
452 const idx = content.indexOf(marker);
453 if (idx === -1) continue;
454 const rest = content.slice(idx + marker.length);
455 const endM = /\n(?:请|注意|在|不要|保持|生成的|禁止|<CG>|如果)/.exec(rest);
456 const end = endM ? endM.index : rest.length;
457 const example = rest.slice(0, end).trim();
458 if (example) return example;
459 }
460 return '';
461}
462
463// ── App extraction ─────────────────────────────────────────────────
464

Callers 1

extractAppsFromEntriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected