buster/packages/ai/src/agents/analytics-engineer-agent/get-analytics-engineer-agen...

35 lines
891 B
TypeScript
Raw Normal View History

import analyticsEngineerAgentPrompt from './analytics-engineer-agent-prompt.txt';
2025-08-06 12:11:48 +08:00
/**
* Template parameters for the docs agent prompt
*/
export interface DocsAgentTemplateParams {
folderStructure: string;
date: string;
}
/**
* Loads the docs agent prompt template and replaces variables
*/
function loadAndProcessPrompt(params: DocsAgentTemplateParams): string {
return analyticsEngineerAgentPrompt
.replace(/\{\{folder_structure\}\}/g, params.folderStructure)
.replace(/\{\{date\}\}/g, params.date);
2025-08-06 12:11:48 +08:00
}
/**
* Export the template function for use in agent files
*/
export const getDocsAgentSystemPrompt = (folderStructure: string): string => {
if (!folderStructure.trim()) {
throw new Error('Folder structure is required');
}
const currentDate = new Date().toISOString();
return loadAndProcessPrompt({
folderStructure,
date: currentDate,
});
};