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 ¶
- type ImageGenTool
- func (t *ImageGenTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *ImageGenTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *ImageGenTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *ImageGenTool) Definition() tool.Definition
- func (t *ImageGenTool) Description(_ context.Context) (string, error)
- func (t *ImageGenTool) FormatResult(data any) string
- func (t *ImageGenTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *ImageGenTool) IsEnabled() bool
- func (t *ImageGenTool) IsReadOnly(_ map[string]any) bool
- func (t *ImageGenTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type STTTool
- func (t *STTTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *STTTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *STTTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *STTTool) Definition() tool.Definition
- func (t *STTTool) Description(_ context.Context) (string, error)
- func (t *STTTool) FormatResult(data any) string
- func (t *STTTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *STTTool) IsEnabled() bool
- func (t *STTTool) IsReadOnly(_ map[string]any) bool
- func (t *STTTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type TTSTool
- func (t *TTSTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *TTSTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *TTSTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *TTSTool) Definition() tool.Definition
- func (t *TTSTool) Description(_ context.Context) (string, error)
- func (t *TTSTool) FormatResult(data any) string
- func (t *TTSTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *TTSTool) IsEnabled() bool
- func (t *TTSTool) IsReadOnly(_ map[string]any) bool
- func (t *TTSTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
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 (*ImageGenTool) Call ¶
func (t *ImageGenTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
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 ¶
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 (*STTTool) Call ¶
func (t *STTTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
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) FormatResult ¶
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 (*TTSTool) Call ¶
func (t *TTSTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
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