From a342973b0907441aea4169d1ee5fbad8c5a50d7c Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Tue, 29 Oct 2024 13:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/apinto/profession.go | 4 ++-- drivers/plugins/ai-prompt/executor.go | 5 +++++ go.mod | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/apinto/profession.go b/app/apinto/profession.go index 17bb7911..156366e8 100644 --- a/app/apinto/profession.go +++ b/app/apinto/profession.go @@ -455,8 +455,8 @@ func ApintoProfession() []*eosc.ProfessionConfig { Name: "fakegpt", // 驱动名称,应和定义文件的provider字段一致 Label: "Fake GPT", Desc: "Fake GPT", - },{ -, Id: "eolinker.com:apinto:zhinao", // 插件ID + }, { + Id: "eolinker.com:apinto:zhinao", // 插件ID Name: "zhinao", // 驱动名称,应和定义文件的provider字段一致 Label: "zhinao", Desc: "zhinao", diff --git a/drivers/plugins/ai-prompt/executor.go b/drivers/plugins/ai-prompt/executor.go index 2b8d3670..c80999ef 100644 --- a/drivers/plugins/ai-prompt/executor.go +++ b/drivers/plugins/ai-prompt/executor.go @@ -41,6 +41,11 @@ func (e *executor) DoHttpFilter(ctx http_context.IHttpContext, next eocontext.IC } body, err = genRequestMessage(body, e.prompt, e.variables, e.required) if err != nil { + result := make(map[string]interface{}) + result["code"] = -1 + result["error"] = err.Error() + marData, _ := json.Marshal(result) + ctx.Response().SetBody(marData) return err } ctx.Proxy().Body().SetRaw("application/json", body) diff --git a/go.mod b/go.mod index b6f01f68..da538fdd 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/clbanning/mxj v1.8.4 github.com/coocood/freecache v1.2.2 github.com/dubbogo/gost v1.13.1 - github.com/eolinker/eosc v0.18.0 + github.com/eolinker/eosc v0.18.1 github.com/fasthttp/websocket v1.5.0 github.com/fullstorydev/grpcurl v1.8.7 github.com/go-redis/redis/v8 v8.11.5