TradingAgents/tradingagents
Laboon 🐋 5450fc9e81 feat: Add Pydantic schema validation at agent boundaries
Closes #434

## Summary

Adds Pydantic-based validation at agent input/output boundaries to:
- Catch validation errors early with clear error messages
- Provide strict schema enforcement for agent outputs
- Support graceful fallback when validation fails

## Changes

1. **New module: **
   -  — validates analyst output with minimum length checks
   -  — validates research debate state
   -  — validates risk management debate state
   -  — validates final trade decisions (BUY/SELL/HOLD)
   -  — validates agent input (ticker, date format)
   -  — strict validation (raises on error)
   -  — graceful fallback (adds error field)

2. **Updated **
   - Added conditional import of validation helpers
   -  flag for feature detection

3. **Added  to dependencies**

4. **Example: **
   - Shows how to wrap existing analyst with validation

## Design Decisions

- **Safe by default**: Uses  which never raises
- **Optional**: Validation is import-guarded; code works without pydantic
- **Non-breaking**: Existing code continues to work; validation is additive
- **Clear errors**: Validation messages explain exactly what failed

## Testing

Built by Laboon 🐋 — AI Assistant powered by Xiaomi MiMo v2 Pro
2026-03-23 09:32:23 +00:00
..
agents feat: Add Pydantic schema validation at agent boundaries 2026-03-23 09:32:23 +00:00
dataflows fix: add exponential backoff retry for yfinance rate limits (#426) 2026-03-22 22:11:08 +00:00
graph refactor: standardize portfolio manager, five-tier rating scale, fix analyst status tracking 2026-03-22 23:30:29 +00:00
llm_clients feat: add Anthropic effort level support for Claude models 2026-03-22 21:57:05 +00:00
__init__.py fix: set process-level UTF-8 default for cross-platform consistency 2026-03-22 23:42:37 +00:00
default_config.py feat: add Anthropic effort level support for Claude models 2026-03-22 21:57:05 +00:00