Álvaro Valenzuela Valdes commited on
Commit ·
7e01ebe
1
Parent(s): db789b9
feat: enhance History view with raw agent thoughts and remove Reports tab
Browse files
backend/app/schemas/analysis.py
CHANGED
|
@@ -59,6 +59,7 @@ class AnalysisResult(BaseModel):
|
|
| 59 |
strategic_roadmap: str | None = None
|
| 60 |
requirement_responses: List[QAResponse] = []
|
| 61 |
audit_log: List[str] = []
|
|
|
|
| 62 |
|
| 63 |
|
| 64 |
class AnalysisRecord(BaseModel):
|
|
|
|
| 59 |
strategic_roadmap: str | None = None
|
| 60 |
requirement_responses: List[QAResponse] = []
|
| 61 |
audit_log: List[str] = []
|
| 62 |
+
raw_responses: dict = {}
|
| 63 |
|
| 64 |
|
| 65 |
class AnalysisRecord(BaseModel):
|
backend/app/services/agents.py
CHANGED
|
@@ -117,6 +117,11 @@ async def run_full_analysis(tender: Tender, company_profile: CompanyProfile, doc
|
|
| 117 |
|
| 118 |
result = AnalysisResult(**parse_result)
|
| 119 |
result.audit_log = audit_log + (result.audit_log or [])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
return result
|
| 121 |
except Exception as e:
|
| 122 |
print(f"Synthesis Validation Error: {e}")
|
|
|
|
| 117 |
|
| 118 |
result = AnalysisResult(**parse_result)
|
| 119 |
result.audit_log = audit_log + (result.audit_log or [])
|
| 120 |
+
result.raw_responses = {
|
| 121 |
+
"legal": legal_resp,
|
| 122 |
+
"technical": tech_resp,
|
| 123 |
+
"strategy": strat_resp
|
| 124 |
+
}
|
| 125 |
return result
|
| 126 |
except Exception as e:
|
| 127 |
print(f"Synthesis Validation Error: {e}")
|
frontend/app/page.tsx
CHANGED
|
@@ -24,7 +24,6 @@ const tabs = [
|
|
| 24 |
"Company Profile",
|
| 25 |
"Agent Analysis",
|
| 26 |
"Proposal Draft",
|
| 27 |
-
"Reports",
|
| 28 |
"History",
|
| 29 |
"About",
|
| 30 |
] as const;
|
|
@@ -286,7 +285,6 @@ export default function HomePage() {
|
|
| 286 |
/>
|
| 287 |
)}
|
| 288 |
{activeTab === "Proposal Draft" && <ProposalDraft proposal={analysisResult?.proposal_draft ?? ""} />}
|
| 289 |
-
{activeTab === "Reports" && <Reports reportMarkdown={analysisResult?.report_markdown ?? ""} />}
|
| 290 |
{activeTab === "History" && <AnalysisHistory history={analysisHistory} />}
|
| 291 |
{activeTab === "About" && <SystemInfo />}
|
| 292 |
</div>
|
|
|
|
| 24 |
"Company Profile",
|
| 25 |
"Agent Analysis",
|
| 26 |
"Proposal Draft",
|
|
|
|
| 27 |
"History",
|
| 28 |
"About",
|
| 29 |
] as const;
|
|
|
|
| 285 |
/>
|
| 286 |
)}
|
| 287 |
{activeTab === "Proposal Draft" && <ProposalDraft proposal={analysisResult?.proposal_draft ?? ""} />}
|
|
|
|
| 288 |
{activeTab === "History" && <AnalysisHistory history={analysisHistory} />}
|
| 289 |
{activeTab === "About" && <SystemInfo />}
|
| 290 |
</div>
|
frontend/components/AnalysisHistory.tsx
CHANGED
|
@@ -56,6 +56,15 @@ export default function AnalysisHistory({ history }: Props) {
|
|
| 56 |
</p>
|
| 57 |
</div>
|
| 58 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
</div>
|
| 60 |
|
| 61 |
<div className="mt-8 grid gap-4 grid-cols-2 md:grid-cols-4">
|
|
@@ -90,6 +99,23 @@ export default function AnalysisHistory({ history }: Props) {
|
|
| 90 |
{isExpanded && (
|
| 91 |
<div className="mt-8 p-6 rounded-3xl bg-black/40 border border-white/5 animate-in slide-in-from-top-4 duration-500">
|
| 92 |
<h4 className="text-[10px] font-black uppercase tracking-widest text-slate-500 mb-4">Agent Intelligence Log (Full Audit)</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
<div className="space-y-3">
|
| 94 |
{item.analysis.audit_log?.map((log, idx) => (
|
| 95 |
<div key={idx} className="flex gap-4 p-3 rounded-xl bg-white/[0.02] border border-white/[0.02]">
|
|
|
|
| 56 |
</p>
|
| 57 |
</div>
|
| 58 |
</div>
|
| 59 |
+
|
| 60 |
+
<div className="flex gap-2">
|
| 61 |
+
<button
|
| 62 |
+
onClick={() => window.print()}
|
| 63 |
+
className="px-4 py-2 rounded-xl bg-white/5 border border-white/10 text-[10px] font-bold text-slate-400 hover:text-white hover:bg-white/10 transition uppercase tracking-[0.2em]"
|
| 64 |
+
>
|
| 65 |
+
Export PDF
|
| 66 |
+
</button>
|
| 67 |
+
</div>
|
| 68 |
</div>
|
| 69 |
|
| 70 |
<div className="mt-8 grid gap-4 grid-cols-2 md:grid-cols-4">
|
|
|
|
| 99 |
{isExpanded && (
|
| 100 |
<div className="mt-8 p-6 rounded-3xl bg-black/40 border border-white/5 animate-in slide-in-from-top-4 duration-500">
|
| 101 |
<h4 className="text-[10px] font-black uppercase tracking-widest text-slate-500 mb-4">Agent Intelligence Log (Full Audit)</h4>
|
| 102 |
+
|
| 103 |
+
{item.analysis.raw_responses && (
|
| 104 |
+
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
|
| 105 |
+
{Object.entries(item.analysis.raw_responses).map(([agent, content]) => (
|
| 106 |
+
<div key={agent} className="space-y-3">
|
| 107 |
+
<div className="flex items-center gap-2">
|
| 108 |
+
<span className="text-xl">{agent === 'legal' ? '⚖️' : agent === 'technical' ? '👨💻' : '🕵️'}</span>
|
| 109 |
+
<span className="text-[10px] font-bold uppercase tracking-[0.2em] text-purple-400">{agent} Agent</span>
|
| 110 |
+
</div>
|
| 111 |
+
<div className="p-4 rounded-2xl bg-white/[0.03] border border-white/5 max-h-[300px] overflow-y-auto custom-scrollbar">
|
| 112 |
+
<p className="text-[11px] text-slate-400 leading-relaxed whitespace-pre-wrap">{content}</p>
|
| 113 |
+
</div>
|
| 114 |
+
</div>
|
| 115 |
+
))}
|
| 116 |
+
</div>
|
| 117 |
+
)}
|
| 118 |
+
|
| 119 |
<div className="space-y-3">
|
| 120 |
{item.analysis.audit_log?.map((log, idx) => (
|
| 121 |
<div key={idx} className="flex gap-4 p-3 rounded-xl bg-white/[0.02] border border-white/[0.02]">
|
frontend/lib/types.ts
CHANGED
|
@@ -78,6 +78,7 @@ export type AnalysisResult = {
|
|
| 78 |
strategic_roadmap?: string;
|
| 79 |
requirement_responses?: QAResponse[];
|
| 80 |
audit_log: string[];
|
|
|
|
| 81 |
};
|
| 82 |
|
| 83 |
export type OCItem = {
|
|
|
|
| 78 |
strategic_roadmap?: string;
|
| 79 |
requirement_responses?: QAResponse[];
|
| 80 |
audit_log: string[];
|
| 81 |
+
raw_responses?: Record<string, string>;
|
| 82 |
};
|
| 83 |
|
| 84 |
export type OCItem = {
|