From dc183e3692711e566226bbe2e462498ca9762687 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Fri, 3 Oct 2025 20:42:36 +0300 Subject: Chore: solving TODOs --- bot.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'bot.go') diff --git a/bot.go b/bot.go index 4a7fa90..10b39f7 100644 --- a/bot.go +++ b/bot.go @@ -85,19 +85,17 @@ func createClient(connectTimeout time.Duration) *http.Client { } } -func fetchModelName() *models.LLMModels { - // TODO: to config - api := "http://localhost:8080/v1/models" +func fetchLCPModelName() *models.LLMModels { //nolint - resp, err := httpClient.Get(api) + resp, err := httpClient.Get(cfg.FetchModelNameAPI) if err != nil { - logger.Warn("failed to get model", "link", api, "error", err) + logger.Warn("failed to get model", "link", cfg.FetchModelNameAPI, "error", err) return nil } defer resp.Body.Close() llmModel := models.LLMModels{} if err := json.NewDecoder(resp.Body).Decode(&llmModel); err != nil { - logger.Warn("failed to decode resp", "link", api, "error", err) + logger.Warn("failed to decode resp", "link", cfg.FetchModelNameAPI, "error", err) return nil } if resp.StatusCode != 200 { @@ -272,7 +270,7 @@ func chatRagUse(qText string) (string, error) { if err != nil { return "", err } - // TODO: this where llm should find the questions in text and ask them + // this where llm should find the questions in text and ask them questionsS := tokenizer.Tokenize(qText) questions := make([]string, len(questionsS)) for i, q := range questionsS { @@ -525,7 +523,7 @@ func applyCharCard(cc *models.CharCard) { } history, err := loadAgentsLastChat(cfg.AssistantRole) if err != nil { - // TODO: too much action for err != nil; loadAgentsLastChat needs to be split up + // too much action for err != nil; loadAgentsLastChat needs to be split up logger.Warn("failed to load last agent chat;", "agent", cc.Role, "err", err) history = []models.RoleMsg{ {Role: "system", Content: cc.SysPrompt}, -- cgit v1.2.3