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