Revert "refactor: rename tool XML wrapper from tool_calls to tool_batch and add schema attention blocks to tool prompts"

This reverts commit ade648033d.
This commit is contained in:
CJACK committed 2026-04-05 20:08:04 +08:00
1 parent ade648033d
commit dc912419c4
6 files changed
+15 -165

No files matched your search

@@ -2,6 +2,7 @@ package openai
import (
"encoding/json"
"fmt"
"strings"
"github.com/google/uuid"
@@ -43,7 +44,11 @@ func injectToolPrompt(messages []map[string]any, tools []any, policy util.ToolCh
continue
}
names = append(names, name)
toolSchemas = append(toolSchemas, util.FormatToolSchemaAttentionBlock(name, desc, schema))
if desc == "" {
desc = "No description available"
}
b, _ := json.Marshal(schema)
toolSchemas = append(toolSchemas, fmt.Sprintf("Tool: %s\nDescription: %s\nParameters: %s", name, desc, string(b)))
}
if len(toolSchemas) == 0 {
return messages, names