Home > @uniformdev/mesh-edgehancer-sdk > AfterAIDataResourceEditHookFn
AfterAIDataResourceEditHookFn type
Shape of a hook function that is invoked after an AI edit has been performed on a data resource. The function can alter the success or value of the edit performed by the LLM.
This hook allows you to: - Apply custom business rules to AI-generated edits - Detect and correct hallucinations in AI output - Transform the AI result into a different format - Validate that the AI edit meets your specific requirements
NOTE: this function is only invoked when a value is edited. If the value is cleared or reset, the function is not invoked (those are internally handled).
NOTE: in most cases, you want createAIDataResourceEdit well before this hook. This hook allows catching hallucinations, applying deterministic business rules, or transforming the format of the AI result into another format.
Signature:
References: AfterAIDataResourceEditContext, AfterAIDataResourceEditResult