mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
Systematic debugging revealed the root cause of Pydantic validation errors: - DeepSeek correctly returns tool_calls.arguments as JSON strings - My wrapper was incorrectly converting strings to dicts - This caused LangChain's parse_tool_call() to fail (json.loads(dict) error) - Failure created invalid_tool_calls with dict args (should be string) - Result: Pydantic validation error on invalid_tool_calls Solution: Remove all conversion logic. DeepSeek format is already correct. ToolCallArgsParsingWrapper now acts as a simple passthrough proxy. Trading session completes successfully with no errors. Fixes the systematic-debugging investigation that identified the issue was in our fix attempt, not in the original API response. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>