client

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
}

func New

func New(endpoint string, opts ...client.ClientOpt) (*Client, error)

New creates a new client, with the endpoint of the whisper service ie, http://localhost:8080/v1

func (*Client) DeleteModel

func (c *Client) DeleteModel(ctx context.Context, model string) error

func (*Client) DownloadModel

func (c *Client) DownloadModel(ctx context.Context, path string, fn func(status string, cur, total int64)) (schema.Model, error)

func (*Client) ListModels

func (c *Client) ListModels(ctx context.Context) ([]schema.Model, error)

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

func (*Client) Transcribe

func (c *Client) Transcribe(ctx context.Context, model string, r io.Reader, opt ...Opt) (*schema.Transcription, error)

func (*Client) Translate

func (c *Client) Translate(ctx context.Context, model string, r io.Reader, opt ...Opt) (*schema.Transcription, error)

type Opt

type Opt func(*opts) error

func OptLanguage

func OptLanguage(language string) Opt

func OptResponseFormat

func OptResponseFormat(v string) Opt

func OptSegmentSize

func OptSegmentSize(v time.Duration) Opt

Jump to

Keyboard shortcuts

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