imagegen

package
v0.2.39 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageReference

func GetImageReference(image *interfaces.GeneratedImage, prompt string) interfaces.ImageReference

GetImageReference returns an ImageReference for storing in memory

Types

type Option

type Option func(*Tool)

Option represents an option for configuring the tool

func WithDefaultAspectRatio

func WithDefaultAspectRatio(ratio string) Option

WithDefaultAspectRatio sets the default aspect ratio

func WithDefaultFormat

func WithDefaultFormat(format string) Option

WithDefaultFormat sets the default output format

func WithMaxPromptLength

func WithMaxPromptLength(maxLen int) Option

WithMaxPromptLength sets maximum prompt length

func WithMaxSessionsPerOrg added in v0.2.36

func WithMaxSessionsPerOrg(max int) Option

WithMaxSessionsPerOrg limits concurrent sessions per organization

func WithMultiTurnEditor added in v0.2.36

func WithMultiTurnEditor(editor interfaces.MultiTurnImageEditor) Option

WithMultiTurnEditor enables multi-turn image editing support. When enabled, the tool automatically manages sessions for iterative image refinement.

func WithMultiTurnModel added in v0.2.36

func WithMultiTurnModel(model string) Option

WithMultiTurnModel sets the model to use for multi-turn editing sessions

func WithSessionTimeout added in v0.2.36

func WithSessionTimeout(timeout time.Duration) Option

WithSessionTimeout sets how long sessions remain active without use

type Tool

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

Tool implements image generation as a tool for agents. When multi-turn editing is enabled, it automatically manages sessions to allow iterative image refinement through conversation.

func New

func New(generator interfaces.ImageGenerator, storage storage.ImageStorage, options ...Option) *Tool

New creates a new image generation tool

func (*Tool) Description

func (t *Tool) Description() string

Description returns what the tool does

func (*Tool) DisplayName

func (t *Tool) DisplayName() string

DisplayName returns a human-friendly name

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, args string) (string, error)

Execute implements the tool execution

func (*Tool) GetActiveSessions added in v0.2.36

func (t *Tool) GetActiveSessions() int

GetActiveSessions returns the number of active sessions (useful for monitoring)

func (*Tool) Internal

func (t *Tool) Internal() bool

Internal returns false as this is a user-visible tool

func (*Tool) Name

func (t *Tool) Name() string

Name returns the tool name

func (*Tool) Parameters

func (t *Tool) Parameters() map[string]interfaces.ParameterSpec

Parameters returns the tool's parameter specifications

func (*Tool) Run

func (t *Tool) Run(ctx context.Context, input string) (string, error)

Run executes the tool with the given input

Jump to

Keyboard shortcuts

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