UNPKG

prompt-version-manager

Version:

Centralized prompt management system for Human Behavior AI agents

85 lines (84 loc) • 3.62 kB
"use strict"; /** * Example usage of the prompt version control system */ Object.defineProperty(exports, "__esModule", { value: true }); exports.testPromptSystem = testPromptSystem; const index_1 = require("./index"); async function testPromptSystem() { console.log('šŸ” Testing Prompt Version Control System'); console.log('====================================='); // List available prompts console.log('\nšŸ“‹ Available Prompts:'); const prompts = index_1.PromptUtils.listAvailablePrompts(); prompts.forEach(prompt => console.log(` - ${prompt}`)); // Test workflow detection prompt console.log('\nšŸ¤– Testing Workflow Detection Prompt:'); const workflowPrompt = index_1.WorkflowAgentPrompts.getWorkflowDetectionPrompt({ projectDescription: 'Project management tool for software teams', formattedData: ` SESSION 1: Team Lead - Navigate to projects dashboard (00:15) - Click create new project (00:30) - Enter project details (01:00) - Invite team members (02:00) - Set up project settings (03:00) SESSION 2: Developer - Navigate to projects dashboard (00:10) - Click create new project (00:25) - Enter project details (00:45) - Configure development settings (01:30) ` }); console.log('Prompt length:', workflowPrompt.length); console.log('Preview (first 200 chars):', workflowPrompt.substring(0, 200) + '...'); // Test review agent prompt console.log('\nšŸ“ Testing Review Agent Prompt:'); const reviewPrompt = index_1.WorkflowAgentPrompts.getReviewAgentPrompt({ workflowsJson: JSON.stringify([{ name: 'Create Project', description: 'User creates a new project', goal: 'Set up project workspace', steps: [ { order: 1, description: 'Navigate to dashboard' }, { order: 2, description: 'Create project' } ], session_ids: ['session-1', 'session-2'] }], null, 2), formattedData: 'Session data here...', projectDescription: 'Project management tool' }); console.log('Review prompt length:', reviewPrompt.length); // Test judge agent prompt console.log('\nāš–ļø Testing Judge Agent Prompt:'); const judgePrompt = index_1.WorkflowAgentPrompts.getJudgeAgentPrompt({ option1Json: JSON.stringify({ workflows: [] }), option2Json: JSON.stringify({ workflows: [] }), formattedData: 'Session data here...', projectDescription: 'Project management tool' }); console.log('Judge prompt length:', judgePrompt.length); // Test deduplication prompt console.log('\nšŸ”„ Testing Deduplication Prompt:'); const dedupPrompt = index_1.WorkflowAgentPrompts.getDeduplicationPrompt({ workflowName: 'Create Project', workflowDescription: 'User creates a new project', workflowGoal: 'Set up project workspace', currentWorkflowSteps: JSON.stringify([ { order: 1, description: 'Navigate to projects' }, { order: 2, description: 'Click create button' } ], null, 2), similarString: `Name: Setup Workspace Description: Initialize project workspace Goal: Create collaborative environment Workflow ID: wf-123 Steps: [{"order": 1, "description": "Navigate to projects"}]` }); console.log('Deduplication prompt length:', dedupPrompt.length); console.log('\nāœ… All prompts loaded successfully!'); } // Run if called directly if (require.main === module) { testPromptSystem().catch(console.error); } //# sourceMappingURL=test-example.js.map