contaigents
Version:
Modular AI Content Ecosystem with Audio Generation
60 lines (59 loc) • 2.49 kB
JavaScript
/**
* Chat Image Generation Test
*
* This script tests that the image generation tool is available in the chat service
*/
import { ToolManager } from '../services/tools/ToolManager.js';
async function testChatImageGeneration() {
console.log('💬 Testing Image Generation Tool in Chat Service');
console.log('='.repeat(50));
try {
// Initialize tool manager (same as used by chat service)
const toolManager = new ToolManager();
// Get available tools
const toolInstructions = toolManager.generateToolInstructions();
console.log('🔧 Checking available tools...');
if (toolInstructions.includes('image_generation')) {
console.log('✅ Image generation tool is available in chat service');
}
else {
console.log('❌ Image generation tool is NOT available in chat service');
}
if (toolInstructions.includes('Generate images from text prompts')) {
console.log('✅ Image generation tool description is present');
}
else {
console.log('❌ Image generation tool description is missing');
}
// Check for required parameters
if (toolInstructions.includes('prompt') && toolInstructions.includes('output_path')) {
console.log('✅ Required parameters (prompt, output_path) are documented');
}
else {
console.log('❌ Required parameters are missing from documentation');
}
// Check for optional parameters
if (toolInstructions.includes('provider') && toolInstructions.includes('width') && toolInstructions.includes('height')) {
console.log('✅ Optional parameters (provider, width, height) are documented');
}
else {
console.log('❌ Some optional parameters are missing from documentation');
}
console.log('');
console.log('🎉 Chat service integration test completed!');
console.log('');
console.log('To test actual image generation in chat:');
console.log(' contaigents chat --provider google');
console.log('');
console.log('Then ask: "Can you generate an image of a sunset over mountains?"');
}
catch (error) {
console.error('❌ Test failed:', error);
process.exit(1);
}
}
// Run if called directly
if (import.meta.url === `file://${process.argv[1]}`) {
testChatImageGeneration();
}