ALwrity Version 0.5.0 (Fastapi + React )

This commit is contained in:
ajaysi
2025-08-06 12:48:02 +05:30
parent f28a919caa
commit 32f97fa6b3
476 changed files with 115544 additions and 28747 deletions

View File

@@ -0,0 +1,40 @@
// Simple test script to verify AI integration
const testAIIntegration = async () => {
try {
console.log('Testing AI Integration...');
// Test the AI analytics endpoint
const response = await fetch('http://localhost:8000/api/content-planning/ai-analytics/');
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log('✅ AI Integration Test Successful!');
console.log('Response:', data);
// Verify the response structure
if (data.insights && data.recommendations) {
console.log('✅ Response structure is correct');
console.log(`📊 Found ${data.insights.length} insights`);
console.log(`💡 Found ${data.recommendations.length} recommendations`);
} else {
console.log('⚠️ Response structure is missing expected fields');
}
} catch (error) {
console.error('❌ AI Integration Test Failed:', error.message);
}
};
// Run the test if this script is executed directly
if (typeof window === 'undefined') {
// Node.js environment
const fetch = require('node-fetch');
testAIIntegration();
} else {
// Browser environment
window.testAIIntegration = testAIIntegration;
console.log('AI Integration test function available as window.testAIIntegration()');
}