diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c8ed0ae..ffa0128c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ # Changelog ## [Unreleased] +### Fixed + +- **LLM Schema Compliance**: Improved prompts to prevent LLMs from returning objects instead of plain strings for `list[str]` fields + - All graph prompts now explicitly state that list fields must contain plain strings only + - Added missing `query` and `confidence` fields to search agent output format documentation + - Fixes validation errors with less capable models that ignore JSON schema constraints +- **AG-UI Frontend Types**: Fixed TypeScript interfaces in ag-ui-research example to match backend Python models + - `EvaluationResult`: `confidence` → `confidence_score`, `should_continue` → `is_sufficient`, `gaps_identified` → `gaps`, `follow_up_questions` → `new_questions`, added `key_insights` + - `ResearchReport`: `question` → `title`, `summary` → `executive_summary`, `findings` → `main_findings`, removed `insights_used`/`methodology`, added `limitations`/`recommendations`/`sources_summary` + - Updated Final Report UI to display new fields (Recommendations, Limitations, Sources) + ## [0.20.1] - 2025-12-11 ### Added diff --git a/examples/ag-ui-research/frontend/components/Agent.tsx b/examples/ag-ui-research/frontend/components/Agent.tsx index a8dc5f59..8a98a3dd 100644 --- a/examples/ag-ui-research/frontend/components/Agent.tsx +++ b/examples/ag-ui-research/frontend/components/Agent.tsx @@ -53,20 +53,22 @@ interface ResearchContext { } interface EvaluationResult { - confidence: number; + key_insights: string[]; + new_questions: string[]; + gaps: string[]; + confidence_score: number; + is_sufficient: boolean; reasoning: string; - should_continue: boolean; - gaps_identified: string[]; - follow_up_questions: string[]; } interface ResearchReport { - question: string; - summary: string; - findings: string[]; + title: string; + executive_summary: string; + main_findings: string[]; conclusions: string[]; - insights_used: string[]; - methodology: string; + limitations: string[]; + recommendations: string[]; + sources_summary: string; } interface ResearchState { diff --git a/examples/ag-ui-research/frontend/components/StateDisplay.tsx b/examples/ag-ui-research/frontend/components/StateDisplay.tsx index b1bb2c39..c0ad3291 100644 --- a/examples/ag-ui-research/frontend/components/StateDisplay.tsx +++ b/examples/ag-ui-research/frontend/components/StateDisplay.tsx @@ -58,20 +58,22 @@ interface ResearchContext { } interface EvaluationResult { - confidence: number; + key_insights: string[]; + new_questions: string[]; + gaps: string[]; + confidence_score: number; + is_sufficient: boolean; reasoning: string; - should_continue: boolean; - gaps_identified: string[]; - follow_up_questions: string[]; } interface ResearchReport { - question: string; - summary: string; - findings: string[]; + title: string; + executive_summary: string; + main_findings: string[]; conclusions: string[]; - insights_used: string[]; - methodology: string; + limitations: string[]; + recommendations: string[]; + sources_summary: string; } interface ResearchState { @@ -179,7 +181,7 @@ export default function StateDisplay({ state }: StateDisplayProps) { state.max_iterations > 0 ? (state.iterations / state.max_iterations) * 100 : 0; - const confidence = state.last_eval?.confidence || 0; + const confidence = state.last_eval?.confidence_score || 0; return (