Remove unused utils import and clean up ImagesGenerations function
This commit is contained in:
parent
91091b8dc2
commit
13a343a7f4
2 changed files with 0 additions and 9 deletions
|
|
@ -10,7 +10,6 @@ import (
|
||||||
jsoniter "github.com/json-iterator/go"
|
jsoniter "github.com/json-iterator/go"
|
||||||
"github.com/yaoapp/gou/process"
|
"github.com/yaoapp/gou/process"
|
||||||
"github.com/yaoapp/kun/exception"
|
"github.com/yaoapp/kun/exception"
|
||||||
"github.com/yaoapp/kun/utils"
|
|
||||||
"github.com/yaoapp/yao/openai"
|
"github.com/yaoapp/yao/openai"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -42,16 +41,11 @@ func ImagesGenerations(process *process.Process) interface{} {
|
||||||
exception.New("ImagesGenerations error: %s", 400, err).Throw()
|
exception.New("ImagesGenerations error: %s", 400, err).Throw()
|
||||||
}
|
}
|
||||||
|
|
||||||
option["prompt"] = prompt
|
|
||||||
option["model"] = model
|
option["model"] = model
|
||||||
option["response_format"] = "url"
|
|
||||||
|
|
||||||
res, ex := ai.ImagesGenerations(prompt, option)
|
res, ex := ai.ImagesGenerations(prompt, option)
|
||||||
if ex != nil {
|
if ex != nil {
|
||||||
utils.Dump(ex)
|
|
||||||
ex.Throw()
|
ex.Throw()
|
||||||
}
|
}
|
||||||
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import (
|
||||||
"github.com/yaoapp/gou/connector"
|
"github.com/yaoapp/gou/connector"
|
||||||
"github.com/yaoapp/gou/http"
|
"github.com/yaoapp/gou/http"
|
||||||
"github.com/yaoapp/kun/exception"
|
"github.com/yaoapp/kun/exception"
|
||||||
"github.com/yaoapp/kun/utils"
|
|
||||||
"github.com/yaoapp/yao/share"
|
"github.com/yaoapp/yao/share"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -211,8 +210,6 @@ func (openai OpenAI) ImagesGenerations(prompt string, option map[string]interfac
|
||||||
}
|
}
|
||||||
|
|
||||||
option["prompt"] = prompt
|
option["prompt"] = prompt
|
||||||
utils.Dump(option)
|
|
||||||
|
|
||||||
return openai.postWithoutModel("/v1/images/generations", option)
|
return openai.postWithoutModel("/v1/images/generations", option)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue