From a06ac694c6a8dbae05dc36a6b327a3d7a7149ae5 Mon Sep 17 00:00:00 2001 From: Matt Low Date: Wed, 13 Mar 2024 05:09:55 +0000 Subject: [PATCH] tui: use EnabledTools from lmcli.Context --- pkg/tui/tui.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/tui/tui.go b/pkg/tui/tui.go index 2710969..cb72484 100644 --- a/pkg/tui/tui.go +++ b/pkg/tui/tui.go @@ -11,7 +11,6 @@ import ( "git.mlow.ca/mlow/lmcli/pkg/lmcli" models "git.mlow.ca/mlow/lmcli/pkg/lmcli/model" - "git.mlow.ca/mlow/lmcli/pkg/lmcli/tools" "github.com/charmbracelet/bubbles/textarea" "github.com/charmbracelet/bubbles/viewport" tea "github.com/charmbracelet/bubbletea" @@ -295,19 +294,11 @@ func (m *model) promptLLM() tea.Cmd { return msgError(err) } - var toolBag []models.Tool - for _, toolName := range *m.ctx.Config.Tools.EnabledTools { - tool, ok := tools.AvailableTools[toolName] - if ok { - toolBag = append(toolBag, tool) - } - } - requestParams := models.RequestParameters{ Model: *m.ctx.Config.Defaults.Model, MaxTokens: *m.ctx.Config.Defaults.MaxTokens, Temperature: *m.ctx.Config.Defaults.Temperature, - ToolBag: toolBag, + ToolBag: m.ctx.EnabledTools, } replyHandler := func(msg models.Message) {