Add get_latest_report tool with equity chart support
**New Tool: get_latest_report** - Returns the most recent backtest report from the database - Includes full report details: metrics, paths, tags, notes, verdict - Optional include_chart parameter (default: true) - Returns equity chart as base64 PNG when available **Implementation:** - ReportDb.get_latest(): Query for most recent report by created_at DESC - handle_get_latest_report(): Fetches report and reads equity.png from charts_dir - Base64 encoding using base64 crate v0.22 - Graceful handling when chart not found (equity_chart_error field) **Files Changed:** - storage/database.rs: Added get_latest() method - tools/definitions.rs: Added tool_get_latest_report() definition - tools/handlers/mod.rs: Added dispatch for get_latest_report - tools/handlers/reports.rs: Implemented handler with base64 chart encoding - Cargo.toml: Added base64 = 0.22 dependency
This commit is contained in:
@@ -27,3 +27,4 @@ encoding_rs = "0.8"
|
||||
tempfile = "3.0"
|
||||
roxmltree = "0.21.1"
|
||||
rusqlite = { version = "0.31", features = ["bundled"] }
|
||||
base64 = "0.22"
|
||||
|
||||
Reference in New Issue
Block a user