Store enabled tools in lmcli.Context
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/model"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/tools"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/util"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
)
|
||||
@@ -27,19 +26,11 @@ func FetchAndShowCompletion(ctx *lmcli.Context, messages []model.Message) ([]mod
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var toolBag []model.Tool
|
||||
for _, toolName := range *ctx.Config.Tools.EnabledTools {
|
||||
tool, ok := tools.AvailableTools[toolName]
|
||||
if ok {
|
||||
toolBag = append(toolBag, tool)
|
||||
}
|
||||
}
|
||||
|
||||
requestParams := model.RequestParameters{
|
||||
Model: *ctx.Config.Defaults.Model,
|
||||
MaxTokens: *ctx.Config.Defaults.MaxTokens,
|
||||
Temperature: *ctx.Config.Defaults.Temperature,
|
||||
ToolBag: toolBag,
|
||||
ToolBag: ctx.EnabledTools,
|
||||
}
|
||||
|
||||
var apiReplies []model.Message
|
||||
|
||||
Reference in New Issue
Block a user