From 13a343a7f4cae89cc84de7f4629140ccc9875fbb Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 7 Nov 2024 17:03:58 +0800 Subject: [PATCH] Remove unused utils import and clean up ImagesGenerations function --- moapi/process.go | 6 ------ openai/openai.go | 3 --- 2 files changed, 9 deletions(-) diff --git a/moapi/process.go b/moapi/process.go index b5271434..e6ba8127 100644 --- a/moapi/process.go +++ b/moapi/process.go @@ -10,7 +10,6 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/yaoapp/gou/process" "github.com/yaoapp/kun/exception" - "github.com/yaoapp/kun/utils" "github.com/yaoapp/yao/openai" ) @@ -42,16 +41,11 @@ func ImagesGenerations(process *process.Process) interface{} { exception.New("ImagesGenerations error: %s", 400, err).Throw() } - option["prompt"] = prompt option["model"] = model - option["response_format"] = "url" - res, ex := ai.ImagesGenerations(prompt, option) if ex != nil { - utils.Dump(ex) ex.Throw() } - return res } diff --git a/openai/openai.go b/openai/openai.go index 5c9e609a..fa0eec68 100644 --- a/openai/openai.go +++ b/openai/openai.go @@ -10,7 +10,6 @@ import ( "github.com/yaoapp/gou/connector" "github.com/yaoapp/gou/http" "github.com/yaoapp/kun/exception" - "github.com/yaoapp/kun/utils" "github.com/yaoapp/yao/share" ) @@ -211,8 +210,6 @@ func (openai OpenAI) ImagesGenerations(prompt string, option map[string]interfac } option["prompt"] = prompt - utils.Dump(option) - return openai.postWithoutModel("/v1/images/generations", option) }