midjourney

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrActionNeeded = errors.New("action needed to continue")
View Source
var ErrActionRequired = errors.New("action required to continue")
View Source
var ErrBannedPrompt = errors.New("banned prompt")
View Source
var ErrCompleteTask = errors.New("please complete the task")
View Source
var ErrEmptyPrompt = errors.New("empty prompt")
View Source
var ErrInvalidLink = errors.New("invalid link")
View Source
var ErrInvalidParameter = errors.New("invalid parameter")

Errors parsed from messages

View Source
var ErrInvalidRequest = errors.New("invalid request")
View Source
var ErrJobActionRestricted = errors.New("job action restricted")
View Source
var ErrJobQueued = errors.New("job queued")
View Source
var ErrMessageNotFound = ai.NewError(errors.New("message not found"), false)

Other errors

View Source
var ErrPendingMod = errors.New("pending mod message")
View Source
var ErrQueueFull = errors.New("queue full")

Functions

func New

func New(client *discord.Client, cfg *Config) (ai.Client, error)

Types

type Client

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

func (*Client) Concurrency

func (c *Client) Concurrency() int

func (*Client) Imagine

func (c *Client) Imagine(ctx context.Context, prompt string) (*ai.Preview, error)

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

func (*Client) Upscale

func (c *Client) Upscale(ctx context.Context, preview *ai.Preview, index int) (string, error)

func (*Client) Variation

func (c *Client) Variation(ctx context.Context, preview *ai.Preview, index int) (*ai.Preview, error)

type Config added in v1.1.4

type Config struct {
	Debug          bool
	ChannelID      string
	ReplicateToken string
	Timeout        time.Duration
	QueuedTimeout  time.Duration
}

type Validator added in v1.0.8

type Validator interface {
	ValidatePrompt(prompt string) error
}

func NewValidator added in v1.0.8

func NewValidator() Validator

Jump to

Keyboard shortcuts

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