mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
docs: update for IF_TRADE and DeepSeek fixes
- Document model factory architecture - Add troubleshooting for DeepSeek validation errors - Update changelog with version 0.4.2 fixes
This commit is contained in:
15
CHANGELOG.md
15
CHANGELOG.md
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.4.2] - 2025-11-05
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed "No trading" message always displaying despite trading activity by initializing `IF_TRADE` to `True` (trades expected by default)
|
||||||
|
- Resolved sporadic Pydantic validation errors for DeepSeek tool_calls arguments by switching to native `ChatDeepSeek` integration
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Added `agent/model_factory.py` for provider-specific model creation
|
||||||
|
- Added `langchain-deepseek` dependency for native DeepSeek support
|
||||||
|
- Added integration tests for DeepSeek tool calls argument parsing
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- `BaseAgent` now uses model factory instead of direct `ChatOpenAI` instantiation
|
||||||
|
- DeepSeek models (`deepseek/*`) now use `ChatDeepSeek` instead of OpenAI compatibility layer
|
||||||
|
|
||||||
## [0.4.1] - 2025-11-05
|
## [0.4.1] - 2025-11-05
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
16
CLAUDE.md
16
CLAUDE.md
@@ -167,12 +167,18 @@ bash main.sh
|
|||||||
### Agent System
|
### Agent System
|
||||||
|
|
||||||
**BaseAgent Key Methods:**
|
**BaseAgent Key Methods:**
|
||||||
- `initialize()`: Connect to MCP services, create AI model
|
- `initialize()`: Connect to MCP services, create AI model via model factory
|
||||||
- `run_trading_session(date)`: Execute single day's trading with retry logic
|
- `run_trading_session(date)`: Execute single day's trading with retry logic
|
||||||
- `run_date_range(init_date, end_date)`: Process all weekdays in range
|
- `run_date_range(init_date, end_date)`: Process all weekdays in range
|
||||||
- `get_trading_dates()`: Resume from last date in position.jsonl
|
- `get_trading_dates()`: Resume from last date in position.jsonl
|
||||||
- `register_agent()`: Create initial position file with $10,000 cash
|
- `register_agent()`: Create initial position file with $10,000 cash
|
||||||
|
|
||||||
|
**Model Factory:**
|
||||||
|
The `create_model()` factory automatically selects the appropriate chat model:
|
||||||
|
- `deepseek/*` models → `ChatDeepSeek` (native tool calling support)
|
||||||
|
- `openai/*` models → `ChatOpenAI`
|
||||||
|
- Other providers → `ChatOpenAI` (OpenAI-compatible endpoint)
|
||||||
|
|
||||||
**Adding Custom Agents:**
|
**Adding Custom Agents:**
|
||||||
1. Create new class inheriting from `BaseAgent`
|
1. Create new class inheriting from `BaseAgent`
|
||||||
2. Add to `AGENT_REGISTRY` in `main.py`:
|
2. Add to `AGENT_REGISTRY` in `main.py`:
|
||||||
@@ -452,4 +458,10 @@ The project uses a well-organized documentation structure:
|
|||||||
**Agent Doesn't Stop Trading:**
|
**Agent Doesn't Stop Trading:**
|
||||||
- Agent must output `<FINISH_SIGNAL>` within `max_steps`
|
- Agent must output `<FINISH_SIGNAL>` within `max_steps`
|
||||||
- Increase `max_steps` if agent needs more reasoning time
|
- Increase `max_steps` if agent needs more reasoning time
|
||||||
- Check `log.jsonl` for errors preventing completion
|
- Check `log.jsonl` for errors preventing completion
|
||||||
|
|
||||||
|
**DeepSeek Pydantic Validation Errors:**
|
||||||
|
- Error: "Input should be a valid dictionary [type=dict_type, input_value='...', input_type=str]"
|
||||||
|
- Cause: Using `ChatOpenAI` for DeepSeek models (OpenAI compatibility layer issue)
|
||||||
|
- Fix: Ensure `langchain-deepseek` is installed and basemodel uses `deepseek/` prefix
|
||||||
|
- The model factory automatically uses `ChatDeepSeek` for native support
|
||||||
Reference in New Issue
Block a user