Skip to content

sanitizeEnrichmentExample

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/libs/parser-core/src/techdocs/example-grounding.ts

If the enrichment markdown's ### Usage Example section calls ungrounded methods on the entity, drop that section (keeping description/diagram/instructions) and return the offending method names. A single hallucinated call makes the whole example untrustworthy — better no example than a lying one. Returns the possibly-rewritten content + what was dropped.

Signature

ts
function sanitizeEnrichmentExample(content: string, entity: Pick<Entity, 'name'> & Record<string, any>): { content: string; dropped: string[] }

Parameters

NameType
contentstring
entityPick<Entity, 'name'> & Record<string, any>

Returns: { content: string; dropped: string[] }

Was this page helpful?

Download as PDF