mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-12 23:36:55 +08:00
fix(agent): use provider registry for claw402, echo reasoning_content for thinking models, add Beta badge
- Agent now uses mcp.NewAIClientByProvider() for claw402 provider, ensuring x402 payment signing works correctly instead of generic HTTP client - Added ReasoningContent field to Message/LLMResponse structs and wired serialization/parsing so DeepSeek thinking models work in multi-turn - Added Beta badge to Agent nav tab in HeaderBar Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -278,8 +278,9 @@ func (client *Client) ParseMCPResponseFull(body []byte) (*LLMResponse, error) {
|
||||
var result struct {
|
||||
Choices []struct {
|
||||
Message struct {
|
||||
Content string `json:"content"`
|
||||
ToolCalls []ToolCall `json:"tool_calls"`
|
||||
Content string `json:"content"`
|
||||
ReasoningContent string `json:"reasoning_content"`
|
||||
ToolCalls []ToolCall `json:"tool_calls"`
|
||||
} `json:"message"`
|
||||
} `json:"choices"`
|
||||
Usage struct {
|
||||
@@ -310,8 +311,9 @@ func (client *Client) ParseMCPResponseFull(body []byte) (*LLMResponse, error) {
|
||||
|
||||
msg := result.Choices[0].Message
|
||||
return &LLMResponse{
|
||||
Content: msg.Content,
|
||||
ToolCalls: msg.ToolCalls,
|
||||
Content: msg.Content,
|
||||
ReasoningContent: msg.ReasoningContent,
|
||||
ToolCalls: msg.ToolCalls,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -624,6 +626,11 @@ func (client *Client) BuildRequestBodyFromRequest(req *Request) map[string]any {
|
||||
} else {
|
||||
m["content"] = msg.Content
|
||||
}
|
||||
// DeepSeek thinking models require reasoning_content to be echoed back
|
||||
// in multi-turn conversations when present in assistant messages.
|
||||
if msg.ReasoningContent != "" {
|
||||
m["reasoning_content"] = msg.ReasoningContent
|
||||
}
|
||||
messages = append(messages, m)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user