Files
trading_bot_v3/test-analysis-api.js
mindesbunister 483d4c6576 🔧 Fix AI Analysis Service - Improved Prompts & Error Handling
 FIXED: AI analysis prompts to bypass OpenAI safety guardrails
 FIXED: Added technical analysis focus instead of trading advice tone
 FIXED: Improved JSON parsing and error handling
 ADDED: Option to use existing screenshots for testing (useExisting param)
 IMPROVED: Better image detail settings and temperature for consistency

🐛 DEBUGGING: Still investigating why AI claims it can't see images
- OpenAI vision capabilities confirmed working with public images
- Model gpt-4o has proper vision support
- Issue appears to be with chart image content or encoding

🎯 NEXT: Debug image encoding and model response inconsistency
2025-07-12 15:08:24 +02:00

31 lines
829 B
JavaScript

const fs = require('fs')
const path = require('path')
async function testAnalysisAPI() {
try {
console.log('🧪 Testing AI analysis API with existing screenshots...')
// Test the API by calling it directly (without requiring new screenshots)
const response = await fetch('http://localhost:3000/api/analyze', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
symbol: 'SOLUSD',
timeframe: '60',
useExisting: true // This will make it use existing screenshots
})
})
const data = await response.json()
console.log('📊 API Response:')
console.log(JSON.stringify(data, null, 2))
} catch (error) {
console.error('❌ Error testing API:', error.message)
}
}
testAnalysisAPI()