remove slices

This commit is contained in:
ParthSareen 2025-10-22 13:47:36 -07:00
parent 08e9ebc7f6
commit 53e26aab2c
2 changed files with 2 additions and 11 deletions

View File

@ -225,15 +225,6 @@ func ToUsage(r api.ChatResponse) Usage {
}
}
// func toolCallId() string {
// const letterBytes = "abcdefghijklmnopqrstuvwxyz0123456789"
// b := make([]byte, 8)
// for i := range b {
// b[i] = letterBytes[rand.Intn(len(letterBytes))]
// }
// return "call_" + strings.ToLower(string(b))
// }
// ToToolCalls converts api.ToolCall to OpenAI ToolCall format
func ToToolCalls(tc []api.ToolCall) []ToolCall {
toolCalls := make([]ToolCall, len(tc))

View File

@ -7,7 +7,6 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/ollama/ollama/api"
"golang.org/x/exp/slices"
)
const (
@ -176,7 +175,8 @@ func TestToToolCallsPreservesIDs(t *testing.T) {
},
}
toolCalls := slices.Clone(original)
toolCalls := make([]api.ToolCall, len(original))
copy(toolCalls, original)
got := ToToolCalls(toolCalls)
if len(got) != len(original) {