Skip to content

entityMethodNames

reference
1 min readUpdated

Kind: Function

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

Grounding check for AI-written usage examples: a code example must not call methods that don't exist on the entity it documents. This catches the classic enrichment hallucination (e.g. a page for RagChatModelService whose example calls createChatCompletion() — a method that isn't on the class). Pure + conservative: it only inspects calls on variables PROVABLY bound to the entity, and no-ops when the entity exposes no method list to ground against.

Signature

ts
function entityMethodNames(entity: Pick<Entity, 'name'> & Record<string, any>): string[]

Parameters

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

Returns: string[]

Was this page helpful?

Download as PDF