speech

package
v0.1.777 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ModelLong = "long"
)

Variables

This section is empty.

Functions

func NewSpeechClient

func NewSpeechClient(ctx context.Context, retryOpts helper.RetryOptions, opts SpeechClientOptions) (contract.SpeechClient, error)

Types

type Client

type Client interface {
	contract.SpeechOperator
}

func NewClient

func NewClient(ctx context.Context, d Dependencies, opts ClientOptions) (Client, error)

type ClientOption

type ClientOption func(*ClientOptions)

func WithCredentialsJSON

func WithCredentialsJSON(x []byte) ClientOption

func WithInitialized

func WithInitialized(x Initialized) ClientOption

func WithLoaded

func WithLoaded(x Loaded) ClientOption

func WithProjectID

func WithProjectID(x string) ClientOption

type ClientOptions

type ClientOptions struct {
	Loaded
	Initialized
}

func ApplyClientOptions

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type DefaultTool

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) Close

func (d *DefaultTool) Close(ctx context.Context) error

Close shuts down the underlying speech client.

func (*DefaultTool) GetMatcher added in v0.1.460

func (d *DefaultTool) GetMatcher(ctx context.Context) (language.Matcher, error)

GetMatcher returns the language matcher used by the speech client.

func (*DefaultTool) Recognize

Recognize performs speech-to-text recognition using a remote audio file.

type Initialized

type Initialized struct {
	Matcher language.Matcher
}

type Loaded

type Loaded struct {
	ProjectID       string
	CredentialsJSON []byte
}

type SpeechClientOptions

type SpeechClientOptions struct {
	Loaded
}

type Tool

type Tool interface {
	Client
}

Jump to

Keyboard shortcuts

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