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) } diff --git a/widgets/form/handler.go b/widgets/form/handler.go index 148ad55d..d582c1f4 100644 --- a/widgets/form/handler.go +++ b/widgets/form/handler.go @@ -106,16 +106,16 @@ func (dsl *DSL) translate(name string, process *gouProcess.Process, data interfa } widgets := []string{} - if dsl.Action.Bind.Model != "" { + if dsl.Action != nil && dsl.Action.Bind != nil && dsl.Action.Bind.Model != "" { m := model.Select(dsl.Action.Bind.Model) widgets = append(widgets, fmt.Sprintf("model.%s", m.ID)) } - if dsl.Action.Bind.Table != "" { + if dsl.Action != nil && dsl.Action.Bind != nil && dsl.Action.Bind.Table != "" { widgets = append(widgets, fmt.Sprintf("table.%s", dsl.Action.Bind.Table)) } - if dsl.Action.Bind.Form != "" { + if dsl.Action != nil && dsl.Action.Bind != nil && dsl.Action.Bind.Form != "" { widgets = append(widgets, fmt.Sprintf("form.%s", dsl.Action.Bind.Form)) }