summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-10-09 10:36:55 +0300
committerGrail Finder <wohilas@gmail.com>2025-10-09 12:23:48 +0300
commit314c07835e62f575ab8cd6f4c3c92bab8dd4f856 (patch)
tree63e536f45639c061d7acb58373ff2df84f788f52 /bot.go
parentdc183e3692711e566226bbe2e462498ca9762687 (diff)
Feat: add external tool web search
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/bot.go b/bot.go
index 10b39f7..f8170e1 100644
--- a/bot.go
+++ b/bot.go
@@ -151,13 +151,8 @@ func fetchORModels(free bool) ([]string, error) {
func sendMsgToLLM(body io.Reader) {
choseChunkParser()
- bodyBytes, _ := io.ReadAll(body)
- ok := json.Valid(bodyBytes)
- if !ok {
- panic("invalid json")
- }
// nolint
- req, err := http.NewRequest("POST", cfg.CurrentAPI, bytes.NewReader(bodyBytes))
+ req, err := http.NewRequest("POST", cfg.CurrentAPI, body)
if err != nil {
logger.Error("newreq error", "error", err)
if err := notifyUser("error", "apicall failed:"+err.Error()); err != nil {
@@ -172,7 +167,6 @@ func sendMsgToLLM(body io.Reader) {
// req.Header.Set("Content-Length", strconv.Itoa(len(bodyBytes)))
req.Header.Set("Accept-Encoding", "gzip")
// nolint
- // resp, err := httpClient.Post(cfg.CurrentAPI, "application/json", body)
resp, err := httpClient.Do(req)
if err != nil {
logger.Error("llamacpp api", "error", err)