feat: enhance image request handling and add async support

This commit is contained in:
CaIon
2025-08-24 21:52:56 +08:00
parent 808f5c481e
commit 7fbf9c4851
4 changed files with 77 additions and 25 deletions

View File

@@ -25,6 +25,8 @@ type ImageRequest struct {
PartialImages json.RawMessage `json:"partial_images,omitempty"`
// Stream bool `json:"stream,omitempty"`
Watermark *bool `json:"watermark,omitempty"`
// 用匿名参数接收额外参数
Extra map[string]json.RawMessage `json:"-"`
}
func (i *ImageRequest) GetTokenCountMeta() *types.TokenCountMeta {
@@ -72,6 +74,7 @@ func (i *ImageRequest) SetModelName(modelName string) {
type ImageResponse struct {
Data []ImageData `json:"data"`
Created int64 `json:"created"`
Extra any `json:"extra,omitempty"`
}
type ImageData struct {
Url string `json:"url"`