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
- 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
79 lines
2.5 KiB
JavaScript
79 lines
2.5 KiB
JavaScript
const https = require('https');
|
|
|
|
async function checkDocumentStatus(documentId) {
|
|
return new Promise((resolve, reject) => {
|
|
const options = {
|
|
hostname: 'api-76ut2tki7q-uc.a.run.app',
|
|
port: 443,
|
|
path: `/documents/${documentId}/status`,
|
|
method: 'GET',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
}
|
|
};
|
|
|
|
const req = https.request(options, (res) => {
|
|
let data = '';
|
|
|
|
res.on('data', (chunk) => {
|
|
data += chunk;
|
|
});
|
|
|
|
res.on('end', () => {
|
|
try {
|
|
const response = JSON.parse(data);
|
|
resolve({ status: res.statusCode, data: response });
|
|
} catch (error) {
|
|
resolve({ status: res.statusCode, data: data });
|
|
}
|
|
});
|
|
});
|
|
|
|
req.on('error', (error) => {
|
|
reject(error);
|
|
});
|
|
|
|
req.end();
|
|
});
|
|
}
|
|
|
|
async function main() {
|
|
const documentId = 'f5509048-d282-4316-9b65-cb89bf8ac09d';
|
|
|
|
console.log(`🔍 Checking status for document: ${documentId}`);
|
|
|
|
try {
|
|
const result = await checkDocumentStatus(documentId);
|
|
console.log('\n📊 API Response:');
|
|
console.log(` Status Code: ${result.status}`);
|
|
console.log(` Response:`, JSON.stringify(result.data, null, 2));
|
|
|
|
if (result.status === 200 && result.data) {
|
|
console.log('\n📄 Document Status Summary:');
|
|
console.log(` ID: ${result.data.id}`);
|
|
console.log(` Name: ${result.data.name}`);
|
|
console.log(` Status: ${result.data.status}`);
|
|
console.log(` Created: ${result.data.created_at}`);
|
|
console.log(` Completed: ${result.data.processing_completed_at || 'Not completed'}`);
|
|
console.log(` Error: ${result.data.error_message || 'None'}`);
|
|
console.log(` Has Analysis Data: ${result.data.has_analysis_data}`);
|
|
console.log(` Analysis Data Keys: ${result.data.analysis_data_keys.join(', ') || 'None'}`);
|
|
|
|
if (result.data.status === 'processing_llm' || result.data.status === 'processing') {
|
|
const processingTime = new Date() - new Date(result.data.created_at);
|
|
const hoursSinceCreation = processingTime / (1000 * 60 * 60);
|
|
console.log(`\n⏱️ Processing Time: ${hoursSinceCreation.toFixed(2)} hours`);
|
|
|
|
if (hoursSinceCreation > 1) {
|
|
console.log('⚠️ Document has been processing for over 1 hour - may be stuck');
|
|
}
|
|
}
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error checking document status:', error.message);
|
|
}
|
|
}
|
|
|
|
main();
|