mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-21 09:28:14 +00:00
fix: deduplicate assistant content in multi-tool turns to prevent premature loop exit
- process.go: only emit resp.Content on the first tool call per batch, subsequent assistant messages use empty content (serialized as null) - provider.go: MarshalJSON outputs null content when empty with tool_calls to comply with DeepSeek/OpenAI expected format - output.go: update parameter interface (payload/type/meta) to match tool definitions (uncommitted from previous refactor)
This commit is contained in:
@ -47,8 +47,10 @@ func (m Message) MarshalJSON() ([]byte, error) {
|
||||
}
|
||||
if len(m.Blocks) > 0 {
|
||||
raw["content"] = m.Blocks
|
||||
} else {
|
||||
} else if m.Content != "" || len(m.ToolCalls) == 0 {
|
||||
raw["content"] = m.Content
|
||||
} else {
|
||||
raw["content"] = nil
|
||||
}
|
||||
if m.ReasoningContent != "" {
|
||||
raw["reasoning_content"] = m.ReasoningContent
|
||||
|
||||
Reference in New Issue
Block a user