Commit Graph

8 Commits

Author SHA1 Message Date
ZhouYongyou
366ae87077 style: format Go code with go fmt
- Fix formatting issues flagged by PR advisory checks
- Run go fmt ./... on all Go files
- No functional changes, code style improvements only

Files formatted:
- api/server.go
- auth/auth.go
- decision/engine.go
- logger/decision_logger.go
- manager/trader_manager.go
- market/monitor.go
- market/types.go
- mcp/client.go
- trader/*.go (aster, auto, binance, hyperliquid)
2025-11-03 19:35:41 +08:00
ZhouYongyou
46053c5fe9 fix: 添加 HTTP/2 stream error 到可重試錯誤列表
問題:
- 用戶遇到錯誤:stream error: stream ID 1; INTERNAL_ERROR
- 這是 HTTP/2 連接被服務端關閉的錯誤
- 當前重試機制不包含此類錯誤,導致直接失敗

修復:
- 添加 "stream error" 到可重試列表
- 添加 "INTERNAL_ERROR" 到可重試列表
- 遇到此類錯誤時會自動重試(最多 3 次)

影響:
- 提高 API 調用穩定性
- 自動處理服務端臨時故障
- 減少因網絡波動導致的失敗
2025-11-02 09:05:47 +08:00
SkywalkerJi
48d1320209 * Fixed the custom model URL.
*   Added functionality for custom model names.
2025-11-01 16:09:15 +08:00
tpkeeper
69445594e3 optimize(mcp/client): correct receiver name 2025-10-31 22:24:10 +08:00
tpkeeper
1083c06d1f Fix mcp defaultConfig override issue in multi-trader, multi-AI model scenario 2025-10-30 15:46:17 +08:00
SkywalkerJi
9886c61ea0 When a custom URL ends with #, force the use of the full URL without appending /chat/completions. 2025-10-30 10:38:15 +08:00
btcman
2cdfb87144 Feature: Add support for custom OpenAI-compatible API
This update enables users to configure any OpenAI-compatible API endpoint,
allowing the use of:
- OpenAI official API (GPT-4, GPT-4o, etc.)
- OpenRouter (access to multiple models)
- Local deployed models (Ollama, LM Studio, etc.)
- Other OpenAI-format compatible API services

Changes:
- config: Add custom_api_url, custom_api_key, custom_model_name fields
- mcp: Add SetCustomAPI function and ProviderCustom constant
- trader: Update AI initialization logic to support custom API
- manager: Pass custom API config to trader instances
- Add CUSTOM_API.md documentation with usage examples
- Update config.json.example with custom API sample

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 22:48:28 +08:00
tinkle
f3a87b5a7a Refactor: Modularize codebase with separate decision and MCP packages
Architecture improvements:
- Extract AI decision engine to dedicated `decision` package
- Create `mcp` package for Model Context Protocol client
- Separate market data structures into `market/data.go`
- Update trader to use new modular structure

New packages:
- `decision/engine.go` - AI decision logic and prompt building
- `mcp/client.go` - Unified AI API client (DeepSeek/Qwen)
- `market/data.go` - Market data type definitions

Benefits:
- Better separation of concerns
- Improved code organization and maintainability
- Easier to test individual components
- More flexible AI provider integration
- Cleaner dependency management

Updated imports:
- trader/auto_trader.go now uses decision and mcp packages
- Consistent API across different AI providers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 06:14:57 +08:00