Documentation
¶
Index ¶
- func GetImageReference(image *interfaces.GeneratedImage, prompt string) interfaces.ImageReference
- type Option
- func WithDefaultAspectRatio(ratio string) Option
- func WithDefaultFormat(format string) Option
- func WithMaxPromptLength(maxLen int) Option
- func WithMaxSessionsPerOrg(max int) Option
- func WithMultiTurnEditor(editor interfaces.MultiTurnImageEditor) Option
- func WithMultiTurnModel(model string) Option
- func WithSessionTimeout(timeout time.Duration) Option
- type Tool
- func (t *Tool) Description() string
- func (t *Tool) DisplayName() string
- func (t *Tool) Execute(ctx context.Context, args string) (string, error)
- func (t *Tool) GetActiveSessions() int
- func (t *Tool) Internal() bool
- func (t *Tool) Name() string
- func (t *Tool) Parameters() map[string]interfaces.ParameterSpec
- func (t *Tool) Run(ctx context.Context, input string) (string, error)
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 ¶
WithDefaultAspectRatio sets the default aspect ratio
func WithDefaultFormat ¶
WithDefaultFormat sets the default output format
func WithMaxPromptLength ¶
WithMaxPromptLength sets maximum prompt length
func WithMaxSessionsPerOrg ¶ added in v0.2.36
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
WithMultiTurnModel sets the model to use for multi-turn editing sessions
func WithSessionTimeout ¶ added in v0.2.36
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 ¶
Description returns what the tool does
func (*Tool) DisplayName ¶
DisplayName returns a human-friendly name
func (*Tool) GetActiveSessions ¶ added in v0.2.36
GetActiveSessions returns the number of active sessions (useful for monitoring)
func (*Tool) Parameters ¶
func (t *Tool) Parameters() map[string]interfaces.ParameterSpec
Parameters returns the tool's parameter specifications