feat: Update Gemini model and improve error handling

Switches to the `gemini-2.5-flash` model for potentially faster and more cost-effective analysis.

Enhances error handling in chart analysis to provide more specific user feedback for API rate limits and credit exhaustion.

Adds UI elements for signal history expansion and introduces pair selection for dashboard statistics, improving user interaction and data visualization.
This commit is contained in:
desartstudio95
2026-05-07 13:24:31 +02:00
parent adc6402b04
commit e225cad4b9
4 changed files with 221 additions and 84 deletions
+5 -1
View File
@@ -93,7 +93,11 @@ export const AnalysisView: React.FC<{ userData?: any }> = ({ userData }) => {
} catch (err: any) {
console.error(err);
setError(err.message || 'Falha ao analisar imagem. Verifique se o gráfico está claro.');
let errorMessage = err.message || 'Falha ao analisar imagem. Verifique se o gráfico está claro.';
if (errorMessage.includes('429') || errorMessage.includes('RESOURCE_EXHAUSTED') || errorMessage.includes('prepayment credits')) {
errorMessage = 'Sua cota de uso da API do Google Gemini (IA) foi excedida ou os créditos acabaram. Por favor, acesse o painel do Google AI Studio (https://ai.studio) para verificar seu faturamento e recarregar os créditos.';
}
setError(errorMessage);
} finally {
setIsAnalyzing(false);
}