From 21296b7878476c6b0889785d6e2e5c29e5e86136 Mon Sep 17 00:00:00 2001 From: liyp Date: Sun, 30 Jun 2024 23:36:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(workers):=20=E4=BC=98=E5=8C=96AI?= =?UTF-8?q?=E5=92=8CLSP=E5=B7=A5=E4=BD=9C=E8=80=85=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=A4=84=E7=90=86=E5=92=8C=E6=97=A5=E5=BF=97=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workers/ai.go | 2 +- workers/lsp.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/workers/ai.go b/workers/ai.go index 382a1e5..4abacac 100644 --- a/workers/ai.go +++ b/workers/ai.go @@ -83,7 +83,7 @@ func (a *AI) GetMsg() string { log.Println("PROMRT 未配置") PROMPT = "" } - println("PROMPT:", PROMPT) + // println("PROMPT:", PROMPT) requestBody := map[string]interface{}{ "model": MODEL, "messages": []map[string]string{{ diff --git a/workers/lsp.go b/workers/lsp.go index 0845549..ebd1ea5 100644 --- a/workers/lsp.go +++ b/workers/lsp.go @@ -18,10 +18,13 @@ func (a *Lsp) GetMsg() string { url := "https://api.lolicon.app/setu/v2?r18=0&size=small" resp, err := http.Get(url) if err != nil { - return "获取失败" + return "请求图片失败" } defer resp.Body.Close() budy, err := io.ReadAll(resp.Body) + if err != nil { + return "读取失败" + } var res map[string]interface{} err = json.Unmarshal(budy, &res) if err != nil {