🤖 COMPLETE: Learning-Enhanced AI with HTTP Compatibility
LEARNING INTEGRATION: - Enhanced AI analysis service feeds historical data into OpenAI prompts - Symbol/timeframe specific learning optimization - Pattern recognition from past trade outcomes - Confidence adjustment based on success rates HTTP COMPATIBILITY SYSTEM: - HttpUtil with automatic curl/no-curl detection - Node.js fallback for Docker environments without curl - Updated all automation systems to use HttpUtil - Production-ready error handling AUTONOMOUS RISK MANAGEMENT: - Enhanced risk manager with learning integration - Simplified learners using existing AILearningData schema - Real-time position monitoring every 30 seconds - Smart stop-loss decisions with AI learning INFRASTRUCTURE: - Database utility for shared Prisma connections - Beach mode status display system - Complete error handling and recovery - Docker container compatibility tested Historical performance flows into OpenAI prompts before every trade.
This commit is contained in:
@@ -198,7 +198,9 @@ export async function POST(request) {
|
||||
|
||||
try {
|
||||
if (allScreenshots.length === 1) {
|
||||
analysis = await aiAnalysisService.analyzeScreenshot(allScreenshots[0])
|
||||
// Use enhanced AI analysis with symbol and primary timeframe for learning
|
||||
const primaryTimeframe = timeframes[0] || '1h';
|
||||
analysis = await aiAnalysisService.analyzeScreenshot(allScreenshots[0], symbol, primaryTimeframe)
|
||||
} else {
|
||||
analysis = await aiAnalysisService.analyzeMultipleScreenshots(allScreenshots)
|
||||
}
|
||||
@@ -210,9 +212,7 @@ export async function POST(request) {
|
||||
// Store analysis for learning
|
||||
await storeAnalysisForLearning(symbol, analysis)
|
||||
} else {
|
||||
console.log('⏳ AI analysis returned null (possibly rate limited) - continuing without analysis')
|
||||
progressTracker.updateStep(sessionId, 'analysis', 'skipped', 'AI analysis skipped due to rate limits or other issues')
|
||||
analysis = null
|
||||
throw new Error('AI analysis returned null')
|
||||
}
|
||||
|
||||
} catch (analysisError) {
|
||||
|
||||
Reference in New Issue
Block a user