From 1d5af981b5b3e082b19e362ba125268bd5e676b0 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sun, 14 Dec 2025 09:58:24 +0300 Subject: Enha: model list based on current api --- props_table.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'props_table.go') diff --git a/props_table.go b/props_table.go index 7807522..dd359f4 100644 --- a/props_table.go +++ b/props_table.go @@ -4,6 +4,7 @@ import ( "fmt" "slices" "strconv" + "strings" "github.com/gdamore/tcell/v2" "github.com/rivo/tview" @@ -134,9 +135,16 @@ func makePropsTable(props map[string]float32) *tview.Table { addListPopupRow("Select an api", apiLinks, cfg.CurrentAPI, func(option string) { cfg.CurrentAPI = option }) + var modelList []string + // INFO: modelList is chosen based on current api link + if strings.Contains(cfg.CurrentAPI, "api.deepseek.com/") { + modelList = []string{chatBody.Model, "deepseek-chat", "deepseek-reasoner"} + } else if strings.Contains(cfg.CurrentAPI, "opentouter.ai") { + modelList = ORFreeModels + } else { // would match on localhost but what if llama.cpp served non localy? + modelList = LocalModels + } // Prepare model list dropdown - modelList := []string{chatBody.Model, "deepseek-chat", "deepseek-reasoner"} - modelList = append(modelList, ORFreeModels...) addListPopupRow("Select a model", modelList, chatBody.Model, func(option string) { chatBody.Model = option }) -- cgit v1.2.3