mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
Added ToolCallArgsParsingWrapper to handle AI providers (like DeepSeek) that return tool_calls.args as JSON strings instead of dictionaries. The wrapper monkey-patches ChatOpenAI's _create_chat_result method to parse string arguments before AIMessage construction, preventing Pydantic validation errors. Changes: - New: agent/chat_model_wrapper.py - Wrapper implementation - Modified: agent/base_agent/base_agent.py - Wrap model during init - Modified: CHANGELOG.md - Document fix as v0.4.1 - New: tests/unit/test_chat_model_wrapper.py - Unit tests Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>