speak

package
v0.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package speak provides a tool for text-to-speech synthesis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inputs

type Inputs struct {
	Text       string `` /* 127-byte string literal not displayed */
	OutputPath string `` /* 127-byte string literal not displayed */
	Voice      string `json:"voice,omitempty" jsonschema:"description=Voice identifier (e.g. alloy\\, af_heart). Default from config."`
}

Inputs defines the parameters for the Speak tool.

type Tool

type Tool struct {
	tool.Base

	// Cfg is the full config — needed because this tool creates sub-agents
	// via agent.New(), which requires access to agents, providers, modes,
	// and the full BuildAgent pipeline.
	Cfg      config.Config
	CfgPaths config.Paths
	Rt       *config.Runtime
}

Tool implements text-to-speech synthesis via a TTS server.

func New

func New(cfg config.Config, paths config.Paths, rt *config.Runtime) *Tool

New creates a Speak tool with the given configuration.

func (*Tool) Available

func (t *Tool) Available() bool

Available checks if the TTS agent is configured.

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, args map[string]any) (string, error)

Execute synthesizes speech from text and writes the audio to a file.

func (*Tool) Name

func (t *Tool) Name() string

Name returns the tool's identifier.

func (*Tool) Paths

func (t *Tool) Paths(ctx context.Context, args map[string]any) (read, write []string, err error)

Paths returns the filesystem paths this tool call will access.

func (*Tool) Sandboxable

func (t *Tool) Sandboxable() bool

Sandboxable returns false because the tool makes network calls.

func (*Tool) Schema

func (t *Tool) Schema() tool.Schema

Schema returns the provider-agnostic tool definition.

Jump to

Keyboard shortcuts

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