mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-10 22:36:58 +08:00
fix(telegram): fix claude client dispatch + strategy creation workflow
- telegram/bot.go: clientForProvider now returns NewClaudeClient() for
'claude' provider (was incorrectly falling back to DeepSeekClient which
uses OpenAI wire format, breaking Anthropic API calls)
- api/server.go: fix scan_interval_minutes schema default (3, not 60);
POST /api/strategies now clearly states config is OPTIONAL with complete
working defaults; POST /api/traders removes redundant GET workflow note
- telegram/agent/prompt.go: simplify strategy creation — just POST {name}
without config (backend applies full working defaults automatically);
only include config when user requests custom settings
This commit is contained in:
@@ -254,9 +254,12 @@ func clientForProvider(provider string) mcp.AIClient {
|
||||
return mcp.NewOpenAIClient()
|
||||
case "deepseek":
|
||||
return mcp.NewDeepSeekClient()
|
||||
case "claude":
|
||||
// Anthropic Messages API — different wire format (x-api-key, input_schema, tool_use blocks).
|
||||
return mcp.NewClaudeClient()
|
||||
default:
|
||||
// Qwen, Kimi, Grok, Gemini, Claude, custom: fall back to DeepSeek-format client.
|
||||
// These providers use OpenAI-compatible APIs; CustomAPIURL and CustomModelName are required.
|
||||
// Qwen, Kimi, Grok, Gemini, custom: OpenAI-compatible APIs.
|
||||
// CustomAPIURL and CustomModelName are required for these providers.
|
||||
return mcp.NewDeepSeekClient()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user