From cd48fb0fbdac4e32549b770473e9fa6f59a4a739 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Thu, 9 Oct 2025 18:03:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E6=9E=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/llm_service/ollama.go | 4 ++++ internal/tools/zltx_order_detail.go | 2 +- internal/tools/zltx_product.go | 3 +-- internal/tools/zltx_statistics.go | 3 +-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/biz/llm_service/ollama.go b/internal/biz/llm_service/ollama.go index 9a7ee25..61a4418 100644 --- a/internal/biz/llm_service/ollama.go +++ b/internal/biz/llm_service/ollama.go @@ -87,6 +87,9 @@ func (r *OllamaService) getPrompt(ctx context.Context, requireData *entitys.Requ } func (r *OllamaService) RecognizeWithImg(ctx context.Context, requireData *entitys.RequireData) (desc api.GenerateResponse, err error) { + if requireData.ImgByte == nil { + return + } requireData.Ch <- entitys.Response{ Index: "", Content: "图片识别中。。。", @@ -97,6 +100,7 @@ func (r *OllamaService) RecognizeWithImg(ctx context.Context, requireData *entit Stream: new(bool), System: "识别图片内容", Prompt: requireData.UserInput, + Images: requireData.ImgByte, }) return } diff --git a/internal/tools/zltx_order_detail.go b/internal/tools/zltx_order_detail.go index 88e90b2..8291d12 100644 --- a/internal/tools/zltx_order_detail.go +++ b/internal/tools/zltx_order_detail.go @@ -114,7 +114,7 @@ func (w *ZltxOrderDetailTool) getZltxOrderDetail(requireData *entitys.RequireDat return } if codeMap["code"].(float64) != 200 { - return fmt.Errorf("订单查询失败:状态码错误:%s", codeMap["error"]) + return fmt.Errorf("订单查询失败:状态码错误:%s", string(res.Content)) } var resData ZltxOrderDetailResponse diff --git a/internal/tools/zltx_product.go b/internal/tools/zltx_product.go index d8c36e8..b3b2305 100644 --- a/internal/tools/zltx_product.go +++ b/internal/tools/zltx_product.go @@ -3,7 +3,6 @@ package tools import ( "ai_scheduler/internal/config" "ai_scheduler/internal/entitys" - "ai_scheduler/internal/pkg" "context" "encoding/json" "fmt" @@ -168,7 +167,7 @@ func (z ZltxProductTool) getZltxProduct(body *ZltxProductRequest, requireData *e return fmt.Errorf("解析商品数据失败:%w", err) } if resp.Code != 200 { - return fmt.Errorf("商品查询失败:%s", pkg.JsonStringIgonErr(resp)) + return fmt.Errorf("商品查询失败:%s", string(res.Content)) } if resp.Data.List == nil || len(resp.Data.List) == 0 { var respData ZltxProductDataById diff --git a/internal/tools/zltx_statistics.go b/internal/tools/zltx_statistics.go index d15d552..e25c51e 100644 --- a/internal/tools/zltx_statistics.go +++ b/internal/tools/zltx_statistics.go @@ -3,7 +3,6 @@ package tools import ( "ai_scheduler/internal/config" "ai_scheduler/internal/entitys" - "ai_scheduler/internal/pkg" "context" "encoding/json" "fmt" @@ -96,7 +95,7 @@ func (z ZltxOrderStatisticsTool) getZltxOrderStatistics(number string, requireDa return err } if resData.Code != 200 { - return fmt.Errorf("为获取到数据,请检查权限: %s", pkg.JsonStringIgonErr(resData)) + return fmt.Errorf("为获取到数据,请检查权限: %s", string(res.Content)) } //按照日期排序 sort.Slice(resData.Data.RecentThreeDays, func(i, j int) bool {