Files
cim_summary/debug-processing.js
Jon 185c780486
Some checks failed
CI/CD Pipeline / Backend - Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend - Lint & Test (push) Has been cancelled
CI/CD Pipeline / Security Scan (push) Has been cancelled
CI/CD Pipeline / Build Backend (push) Has been cancelled
CI/CD Pipeline / Build Frontend (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Performance Tests (push) Has been cancelled
CI/CD Pipeline / Dependency Updates (push) Has been cancelled
🚀 Update to Claude 3.7 latest and fix LLM processing issues
- Updated Anthropic API to latest version (2024-01-01)
- Set Claude 3.7 Sonnet Latest as primary model
- Removed deprecated Opus 3.5 references
- Fixed LLM response validation and JSON parsing
- Improved error handling and logging
- Updated model configurations and pricing
- Enhanced document processing reliability
- Fixed TypeScript type issues
- Updated environment configuration
2025-08-17 17:31:56 -04:00

74 lines
2.5 KiB
JavaScript

// Debug script to test document processing in the testing environment
const axios = require('axios');
const API_BASE = 'https://us-central1-cim-summarizer-testing.cloudfunctions.net/api';
async function debugProcessing() {
console.log('🔍 Starting debug of document processing...');
try {
// First, check if any documents exist in the testing environment
console.log('\n📋 Checking recent documents...');
const docsResponse = await axios.get(`${API_BASE}/documents`, {
headers: {
'Authorization': 'Bearer test-token'
}
}).catch(err => {
console.log('❌ Could not fetch documents (expected - auth required)');
return null;
});
// Check health endpoint
console.log('\n🏥 Checking API health...');
const healthResponse = await axios.get(`${API_BASE}/health`);
console.log('✅ Health check:', healthResponse.data);
// Test a simple LLM request through the processing endpoint
console.log('\n🤖 Testing LLM processing capabilities...');
// Create a test document payload
const testDocument = {
id: 'debug-test-001',
content: `
CONFIDENTIAL INVESTMENT MEMORANDUM
TEST COMPANY INC.
EXECUTIVE SUMMARY
Test Company Inc. is a technology startup providing AI-powered solutions
for small businesses. Founded in 2020, the company has achieved $2.5M
in annual revenue with 150 employees.
BUSINESS OVERVIEW
Core Operations: AI software development
Revenue Model: SaaS subscriptions
Key Products: Business AI Platform, Analytics Dashboard
FINANCIAL PERFORMANCE
FY 2023: Revenue $2,500,000, EBITDA $750,000
FY 2022: Revenue $1,200,000, EBITDA $240,000
MARKET ANALYSIS
Total Addressable Market: $15B
Growth Rate: 25% annually
Competition: Established players and startups
`,
metadata: {
filename: 'test-debug.pdf',
fileSize: 1500
}
};
console.log('📄 Sample document content length:', testDocument.content.length);
console.log('📄 Sample content preview:', testDocument.content.substring(0, 200) + '...');
} catch (error) {
console.error('❌ Debug failed:', error.message);
if (error.response) {
console.error(' Response status:', error.response.status);
console.error(' Response data:', error.response.data);
}
}
}
debugProcessing();