showWebSearchStatus prints the current override, SearxNG config, and the active fallback chain that a query would actually use right now.
()
| 50 | // showWebSearchStatus prints the current override, SearxNG config, and the |
| 51 | // active fallback chain that a query would actually use right now. |
| 52 | func (cli *ChatCLI) showWebSearchStatus() { |
| 53 | fmt.Println() |
| 54 | fmt.Println(uiBox("🔎", i18n.T("ws.cmd.box_title"), ColorCyan)) |
| 55 | p := uiPrefix(ColorCyan) |
| 56 | |
| 57 | override := os.Getenv("CHATCLI_WEBSEARCH_PROVIDER") |
| 58 | if override == "" { |
| 59 | override = "auto" |
| 60 | } |
| 61 | searxngURL := os.Getenv("SEARXNG_URL") |
| 62 | |
| 63 | fmt.Println(p + fmt.Sprintf(" %s%-16s%s %s", |
| 64 | ColorGray, i18n.T("ws.cmd.kv_override")+":", ColorReset, override)) |
| 65 | if searxngURL != "" { |
| 66 | fmt.Println(p + fmt.Sprintf(" %s%-16s%s %s", |
| 67 | ColorGray, i18n.T("ws.cmd.kv_searxng_url")+":", ColorReset, searxngURL)) |
| 68 | } else { |
| 69 | fmt.Println(p + fmt.Sprintf(" %s%-16s%s %s", |
| 70 | ColorGray, i18n.T("ws.cmd.kv_searxng_url")+":", ColorReset, |
| 71 | i18n.T("ws.cmd.searxng_not_configured"))) |
| 72 | } |
| 73 | |
| 74 | fmt.Println(p + "") |
| 75 | fmt.Println(p + fmt.Sprintf(" %s%s%s", ColorGray, i18n.T("ws.cmd.active_chain_header"), ColorReset)) |
| 76 | for i, name := range plugins.SelectSearchChainNames() { |
| 77 | marker := "↓" |
| 78 | if i == 0 { |
| 79 | marker = "★" |
| 80 | } |
| 81 | fmt.Println(p + fmt.Sprintf(" %s %d. %s", marker, i+1, name)) |
| 82 | } |
| 83 | fmt.Println() |
| 84 | } |
| 85 | |
| 86 | // showWebSearchList enumerates all known providers with configured-or-not state. |
| 87 | func (cli *ChatCLI) showWebSearchList() { |
no test coverage detected