dashscope

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithN

func WithN(n int) images.Option

WithN 设置输出图像的数量(仅 qwen-image-2.0 系列支持 1-6 张)。

func WithNegativePrompt

func WithNegativePrompt(negativePrompt string) images.Option

WithNegativePrompt 设置反向提示词,用于描述不希望在图像中出现的内容。

func WithPromptExtend

func WithPromptExtend(enable bool) images.Option

WithPromptExtend 设置是否开启 Prompt 智能改写功能。

func WithSeed

func WithSeed(seed int) images.Option

WithSeed 设置随机数种子,使生成内容保持相对稳定。

func WithWatermark

func WithWatermark(enable bool) images.Option

WithWatermark 设置是否在图像右下角添加水印。

Types

type Config

type Config struct {
	APIKey  string        `toml:"apiKey"`
	BaseUrl string        `toml:"baseUrl"`
	Model   string        `toml:"model"`
	Timeout time.Duration `toml:"timeout"`
}

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config, opts ...images.ClientOption) (*Generator, error)

func (*Generator) Generate

func (g *Generator) Generate(ctx context.Context, req *schema.Request, opts ...images.Option) (*schema.Response, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL