Fix tool-call fallback on sanitized empty text and remove history wrapper tags

This commit is contained in:
CJACK.
2026-04-29 23:04:45 +08:00
parent c8922c7a88
commit 33f6fef015
13 changed files with 26 additions and 36 deletions

View File

@@ -6,12 +6,12 @@ import (
"ds2api/internal/toolcall"
)
func DetectAssistantToolCalls(text, exposedThinking, detectionThinking string, toolNames []string) toolcall.ToolCallParseResult {
textParsed := toolcall.ParseStandaloneToolCallsDetailed(text, toolNames)
func DetectAssistantToolCalls(rawText, visibleText, exposedThinking, detectionThinking string, toolNames []string) toolcall.ToolCallParseResult {
textParsed := toolcall.ParseStandaloneToolCallsDetailed(rawText, toolNames)
if len(textParsed.Calls) > 0 {
return textParsed
}
if strings.TrimSpace(text) != "" {
if strings.TrimSpace(visibleText) != "" {
return textParsed
}
thinking := detectionThinking