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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user