mergeHookInstructions function
Merges user-supplied custom instructions with hook-provided instructions.
Implementation
String? mergeHookInstructions(
String? userInstructions,
String? hookInstructions,
) {
if (hookInstructions == null || hookInstructions.isEmpty) {
return (userInstructions != null && userInstructions.isNotEmpty)
? userInstructions
: null;
}
if (userInstructions == null || userInstructions.isEmpty) {
return hookInstructions;
}
return '$userInstructions\n\n$hookInstructions';
}