diff --git a/components/PrintableReport.tsx b/components/PrintableReport.tsx index 9507a5b..3f60576 100644 --- a/components/PrintableReport.tsx +++ b/components/PrintableReport.tsx @@ -27,7 +27,11 @@ const TableRow: React.FC<{item: ComplianceItem}> = ({item}) => ( ) export const PrintableReport: React.FC = ({ report }) => { - const { identification, compliance, overPerformance, equivalents, confidence } = report; + const identification = report?.identification || {}; + const compliance = report?.compliance || { status: 'NÃO CONFORME', mechanical: [], chemical: [], otherTests: [] }; + const overPerformance = report?.overPerformance || []; + const equivalents = report?.equivalents || []; + const confidence = report?.confidence || 0; const jsonData = JSON.stringify(report); return ( diff --git a/components/ReportDisplay.tsx b/components/ReportDisplay.tsx index fa79439..30f7e95 100644 --- a/components/ReportDisplay.tsx +++ b/components/ReportDisplay.tsx @@ -52,7 +52,11 @@ const ComplianceTableRow: React.FC<{ item: ComplianceItem; headerLabel: string } ); export const ReportDisplay: React.FC = ({ report }) => { - const { identification, compliance, overPerformance, equivalents, confidence } = report; + const identification = report?.identification || {}; + const compliance = report?.compliance || { status: 'NÃO CONFORME', mechanical: [], chemical: [], otherTests: [] }; + const overPerformance = report?.overPerformance || []; + const equivalents = report?.equivalents || []; + const confidence = report?.confidence || 0; return (
diff --git a/services/aiService.ts b/services/aiService.ts index cae0b60..41f0bb9 100644 --- a/services/aiService.ts +++ b/services/aiService.ts @@ -462,8 +462,7 @@ export const analyzeWithOpenRouter = async (file: File, apiKey: string, model: s ] } ], - temperature: 0.1, - response_format: { type: 'json_object' } + temperature: 0.1 }) });