client

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LanguageCode added in v0.0.23

func LanguageCode(language string) (string, string)

LanguageCode returns the two-letter (OpenAI) and three-letter (ElevenLabs) codes for a given language, or an empty string if the language is not recognized.

Types

type Client

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

func New

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

New creates a new client, with openai, elevenlabs and other clients

func (*Client) DeleteModel

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

Delete existing model

func (*Client) DownloadModel

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

Download model for use in transcription and translation

func (*Client) ListModels

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

List models for transcription and translation

func (*Client) Transcribe

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

Transcribe performs a transcription request in the language of the speech

func (*Client) Translate

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

Translate performs a transcription request and returns the result in english

type Opt

type Opt func(apitype, *opts) error

func OptDiarize added in v0.0.23

func OptDiarize() Opt

Identify speakers in the audio and return their speech separately.

func OptFormat added in v0.0.23

func OptFormat(v string) Opt

Set format for transcription (json, verbose_json, srt, vtt, text)

func OptLanguage

func OptLanguage(language string) Opt

Set language for transcription

func OptLogprobs added in v0.0.23

func OptLogprobs() Opt

Return the log probabilities of the tokens in the response to understand the model's confidence in the transcription.

func OptPath added in v0.0.23

func OptPath(v string) Opt

Set path for the file to be transcribed

func OptPrompt added in v0.0.23

func OptPrompt(v string) Opt

Text to guide the model's style or continue a previous audio segment.

func OptStream added in v0.0.23

func OptStream() Opt

Model response data will be streamed to the client as it is generated using server-sent events.

func OptTemperature added in v0.0.23

func OptTemperature(v float64) Opt

The sampling temperature, between 0 and 1.

Directories

Path Synopsis
https://elevenlabs.io/docs/overview
https://elevenlabs.io/docs/overview

Jump to

Keyboard shortcuts

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