Files
ngo-toolkit/lib/ai/prompts/index.ts
T
2026-03-18 18:26:24 +08:00

25 lines
1.5 KiB
TypeScript

import { ToolName } from '@/lib/types';
import { logframeMaster, logframeImprove, logframeValidate, logframeFinalize } from './logframe';
import { funderRewriterMaster, funderRewriterImprove, funderRewriterValidate, funderRewriterFinalize } from './funder-rewriter';
import { smartIndicatorsMaster, smartIndicatorsImprove, smartIndicatorsValidate, smartIndicatorsFinalize } from './smart-indicators';
import { theoryOfChangeMaster, theoryOfChangeImprove, theoryOfChangeValidate, theoryOfChangeFinalize } from './theory-of-change';
type PromptFn = (input: Record<string, string>) => string;
type SectionPromptFn = (section: string, feedback: string) => string;
type ValidateFn = (content: string) => string;
type FinalizeFn = (content: string, improvements: string) => string;
interface ToolPrompts {
master: PromptFn;
improve: SectionPromptFn;
validate: ValidateFn;
finalize: FinalizeFn;
}
export const prompts: Record<ToolName, ToolPrompts> = {
logframe: { master: logframeMaster, improve: logframeImprove, validate: logframeValidate, finalize: logframeFinalize },
'funder-rewriter': { master: funderRewriterMaster, improve: funderRewriterImprove, validate: funderRewriterValidate, finalize: funderRewriterFinalize },
'smart-indicators': { master: smartIndicatorsMaster, improve: smartIndicatorsImprove, validate: smartIndicatorsValidate, finalize: smartIndicatorsFinalize },
'theory-of-change': { master: theoryOfChangeMaster, improve: theoryOfChangeImprove, validate: theoryOfChangeValidate, finalize: theoryOfChangeFinalize },
};