UNPKG

contaigents

Version:

Modular AI Content Ecosystem with Audio Generation

139 lines (138 loc) โ€ข 5.87 kB
/** * Phase 1 Test: Generic Agent Identity & System Prompts * * This test verifies that: * 1. Agent has generic identity (not story-focused) * 2. System prompt includes multi-modal capabilities * 3. State machine documentation is present * 4. Intent detection examples are included * 5. Multi-modal usage examples are present */ import { PromptTemplates } from '../services/prompts/PromptTemplates.js'; function testPhase1() { console.log('๐Ÿงช Phase 1 Test: Generic Agent Identity & System Prompts\n'); const systemPrompt = PromptTemplates.getDefaultSystemPrompt(); // Test 1: Generic Identity (NOT story-focused) console.log('Test 1: Generic Identity'); const hasGenericIdentity = systemPrompt.includes('generic content development platform'); const notStoryFocused = !systemPrompt.startsWith('You can create cinematic screenplays'); console.log(` โœ“ Has generic identity: ${hasGenericIdentity ? 'โœ…' : 'โŒ'}`); console.log(` โœ“ Not story-focused opening: ${notStoryFocused ? 'โœ…' : 'โŒ'}`); // Test 2: Multi-Modal Capabilities Listed console.log('\nTest 2: Multi-Modal Capabilities'); const capabilities = [ 'File Operations', 'Audio Tools', 'Video & Image Tools', 'ffmpeg', 'audio_generation', 'speech_to_text', 'image_generation', 'cinematic_workflow' ]; capabilities.forEach(cap => { const hasCapability = systemPrompt.includes(cap); console.log(` โœ“ ${cap}: ${hasCapability ? 'โœ…' : 'โŒ'}`); }); // Test 3: State Machine Documentation console.log('\nTest 3: State Machine Documentation'); const stateChecks = [ 'Story Project State Machine', 'OUTLINE_DRAFT', 'OUTLINE_CONFIRMED', 'SCREENPLAY_WRITING', 'ITERATION', 'workflow_state', 'auto_generate_sketches' ]; stateChecks.forEach(check => { const hasCheck = systemPrompt.includes(check); console.log(` โœ“ ${check}: ${hasCheck ? 'โœ…' : 'โŒ'}`); }); // Test 4: Intent Detection Examples console.log('\nTest 4: Intent Detection Examples'); const intentChecks = [ 'Intent Detection', 'Questions (No Workflow Trigger)', 'Content Analysis (Use Tools, No Story Workflow)', 'Story Project Work (Apply State Machine)', 'Explicit Requests (Always Honor)' ]; intentChecks.forEach(check => { const hasCheck = systemPrompt.includes(check); console.log(` โœ“ ${check}: ${hasCheck ? 'โœ…' : 'โŒ'}`); }); // Test 5: Multi-Modal Usage Examples console.log('\nTest 5: Multi-Modal Usage Examples'); const exampleChecks = [ 'Video Analysis (No Story Workflow)', 'Audio Extraction (No Story Workflow)', 'Question About Story (No Workflow Trigger)', 'Story Project Creation (State Machine Activates)', 'Audio Generation (No Story Context)' ]; exampleChecks.forEach(check => { const hasCheck = systemPrompt.includes(check); console.log(` โœ“ ${check}: ${hasCheck ? 'โœ…' : 'โŒ'}`); }); // Test 6: Critical Behavior Guidelines console.log('\nTest 6: Critical Behavior Guidelines'); const behaviorChecks = [ 'DO NOT assume every request is about story creation', 'Answer questions directly without triggering workflows', 'Use appropriate tools based on user intent', 'Only enter story creation mode when explicitly requested', 'Never automatically change user\'s auto-sketch preference' ]; behaviorChecks.forEach(check => { const hasCheck = systemPrompt.includes(check); console.log(` โœ“ ${check}: ${hasCheck ? 'โœ…' : 'โŒ'}`); }); // Test 7: Tool Examples Present console.log('\nTest 7: Tool Examples Present'); const toolExamples = [ '<tool_call name="ffmpeg"', '<tool_call name="audio_generation"', '<tool_call name="read_file"', '<tool_call name="write_file"', '<tool_call name="cinematic_workflow"' ]; toolExamples.forEach(example => { const hasExample = systemPrompt.includes(example); console.log(` โœ“ ${example}: ${hasExample ? 'โœ…' : 'โŒ'}`); }); // Summary console.log('\n' + '='.repeat(60)); console.log('๐Ÿ“Š Phase 1 Test Summary'); console.log('='.repeat(60)); const allTests = [ hasGenericIdentity, notStoryFocused, ...capabilities.map(c => systemPrompt.includes(c)), ...stateChecks.map(c => systemPrompt.includes(c)), ...intentChecks.map(c => systemPrompt.includes(c)), ...exampleChecks.map(c => systemPrompt.includes(c)), ...behaviorChecks.map(c => systemPrompt.includes(c)), ...toolExamples.map(e => systemPrompt.includes(e)) ]; const passedTests = allTests.filter(t => t).length; const totalTests = allTests.length; const passRate = ((passedTests / totalTests) * 100).toFixed(1); console.log(`\nTests Passed: ${passedTests}/${totalTests} (${passRate}%)`); if (passedTests === totalTests) { console.log('\nโœ… All Phase 1 tests passed! The agent now has:'); console.log(' - Generic content development platform identity'); console.log(' - Multi-modal capabilities documentation'); console.log(' - Story project state machine support'); console.log(' - Intent detection guidelines'); console.log(' - Multi-modal usage examples'); } else { console.log('\nโš ๏ธ Some tests failed. Review the output above.'); } // Optional: Print prompt length console.log(`\n๐Ÿ“ System Prompt Length: ${systemPrompt.length} characters`); console.log(` (${Math.ceil(systemPrompt.length / 4)} estimated tokens)`); } // Run the test testPhase1();