multimedia

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package multimedia groups tools that produce or consume media: images (generate_image), text-to-speech (text_to_speech), and speech-to-text (speech_to_text). All three tools are always registered but IsEnabled returns false when the underlying provider is not configured, so they are safe to register unconditionally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageGenTool

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

ImageGenTool implements the generate_image built-in tool.

func NewImageGenTool

func NewImageGenTool(generator image.Generation) *ImageGenTool

NewImageGenTool creates a generate_image Tool. When generator is nil the tool registers normally but IsEnabled returns false, preventing execution.

func (*ImageGenTool) BackfillInput

func (t *ImageGenTool) BackfillInput(_ context.Context, in map[string]any) map[string]any

func (*ImageGenTool) Call

func (*ImageGenTool) CheckPermissions

func (t *ImageGenTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*ImageGenTool) Definition

func (t *ImageGenTool) Definition() tool.Definition

func (*ImageGenTool) Description

func (t *ImageGenTool) Description(_ context.Context) (string, error)

func (*ImageGenTool) FormatResult

func (t *ImageGenTool) FormatResult(data any) string

func (*ImageGenTool) IsConcurrencySafe

func (t *ImageGenTool) IsConcurrencySafe(_ map[string]any) bool

func (*ImageGenTool) IsEnabled

func (t *ImageGenTool) IsEnabled() bool

func (*ImageGenTool) IsReadOnly

func (t *ImageGenTool) IsReadOnly(_ map[string]any) bool

func (*ImageGenTool) ValidateInput

func (t *ImageGenTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)

type STTTool

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

STTTool implements the speech_to_text built-in tool.

func NewSTTTool

func NewSTTTool(transcriber stt.SpeechToText) *STTTool

NewSTTTool creates a speech_to_text Tool. Disabled when transcriber is nil.

func (*STTTool) BackfillInput

func (t *STTTool) BackfillInput(_ context.Context, in map[string]any) map[string]any

func (*STTTool) Call

func (*STTTool) CheckPermissions

func (t *STTTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*STTTool) Definition

func (t *STTTool) Definition() tool.Definition

func (*STTTool) Description

func (t *STTTool) Description(_ context.Context) (string, error)

func (*STTTool) FormatResult

func (t *STTTool) FormatResult(data any) string

func (*STTTool) IsConcurrencySafe

func (t *STTTool) IsConcurrencySafe(_ map[string]any) bool

func (*STTTool) IsEnabled

func (t *STTTool) IsEnabled() bool

func (*STTTool) IsReadOnly

func (t *STTTool) IsReadOnly(_ map[string]any) bool

func (*STTTool) ValidateInput

func (t *STTTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)

type TTSTool

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

TTSTool implements the text_to_speech built-in tool.

func NewTTSTool

func NewTTSTool(generator tts.Generation) *TTSTool

NewTTSTool creates a text_to_speech Tool. Disabled (IsEnabled=false) when generator is nil.

func (*TTSTool) BackfillInput

func (t *TTSTool) BackfillInput(_ context.Context, in map[string]any) map[string]any

func (*TTSTool) Call

func (*TTSTool) CheckPermissions

func (t *TTSTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*TTSTool) Definition

func (t *TTSTool) Definition() tool.Definition

func (*TTSTool) Description

func (t *TTSTool) Description(_ context.Context) (string, error)

func (*TTSTool) FormatResult

func (t *TTSTool) FormatResult(data any) string

func (*TTSTool) IsConcurrencySafe

func (t *TTSTool) IsConcurrencySafe(_ map[string]any) bool

func (*TTSTool) IsEnabled

func (t *TTSTool) IsEnabled() bool

func (*TTSTool) IsReadOnly

func (t *TTSTool) IsReadOnly(_ map[string]any) bool

func (*TTSTool) ValidateInput

func (t *TTSTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)

Jump to

Keyboard shortcuts

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