fix: fallback tool calls from thinking on empty output

This commit is contained in:
MiY
2026-04-26 17:45:12 +08:00
parent e2dfe15f48
commit a505f2cb96
11 changed files with 162 additions and 17 deletions

View File

@@ -7,7 +7,7 @@ import (
)
func BuildChatCompletion(completionID, model, finalPrompt, finalThinking, finalText string, toolNames []string) map[string]any {
detected := toolcall.ParseStandaloneToolCallsDetailed(finalText, toolNames)
detected := toolcall.ParseAssistantToolCallsDetailed(finalText, finalThinking, toolNames)
finishReason := "stop"
messageObj := map[string]any{"role": "assistant", "content": finalText}
if strings.TrimSpace(finalThinking) != "" {