remove slices
This commit is contained in:
parent
08e9ebc7f6
commit
53e26aab2c
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue