openai

package
v0.0.0-...-66bbac4 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Whisper1 = &common.ASRModel{
		Name:        openai.Whisper1,
		ContextSize: 26214400,
		ContextUnit: schema.ContextUnitByte,
		UsageCost:   &schema.CostObject{Price: 0.006, Unit: schema.CostUnitMinute, UnitSize: 1},
	}
)

Functions

func NewASROpenAI

func NewASROpenAI(token string, model *common.ASRModel) common.ASR

func NewASROpenAIWithDefaultModel

func NewASROpenAIWithDefaultModel(token string) common.ASR

func NewASROptionsOpenAI

func NewASROptionsOpenAI() common.ASROptions

Types

type ASROpenAI

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

func (*ASROpenAI) Transcribe

func (c *ASROpenAI) Transcribe(audioFile string) (common.ASRResult, error)

func (*ASROpenAI) TranscribeWithContext

func (c *ASROpenAI) TranscribeWithContext(ctx context.Context, audioFile string) (common.ASRResult, error)

func (*ASROpenAI) TranscribeWithOptions

func (c *ASROpenAI) TranscribeWithOptions(ctx context.Context, opts common.ASROptions) (common.ASRResult, error)

func (*ASROpenAI) Translate

func (c *ASROpenAI) Translate(audioFile string) (common.ASRResult, error)

func (*ASROpenAI) TranslateWithContext

func (c *ASROpenAI) TranslateWithContext(ctx context.Context, audioFile string) (common.ASRResult, error)

func (*ASROpenAI) TranslateWithOptions

func (c *ASROpenAI) TranslateWithOptions(ctx context.Context, opts common.ASROptions) (common.ASRResult, error)

type ASROptionsOpenAI

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

func (ASROptionsOpenAI) GetAudioFile

func (c ASROptionsOpenAI) GetAudioFile() string

func (ASROptionsOpenAI) GetRequest

func (c ASROptionsOpenAI) GetRequest() interface{}

func (ASROptionsOpenAI) GetTimeout

func (c ASROptionsOpenAI) GetTimeout() time.Duration

func (ASROptionsOpenAI) WithAudioFile

func (c ASROptionsOpenAI) WithAudioFile(audioFile string) common.ASROptions

func (ASROptionsOpenAI) WithLanguage

func (c ASROptionsOpenAI) WithLanguage(language string) common.ASROptions

func (ASROptionsOpenAI) WithModel

func (c ASROptionsOpenAI) WithModel(model string) common.ASROptions

func (ASROptionsOpenAI) WithOutputFormat

func (c ASROptionsOpenAI) WithOutputFormat(format string) common.ASROptions

func (ASROptionsOpenAI) WithPrompt

func (c ASROptionsOpenAI) WithPrompt(prompt string) common.ASROptions

func (ASROptionsOpenAI) WithTemperature

func (c ASROptionsOpenAI) WithTemperature(temperature float32) common.ASROptions

func (ASROptionsOpenAI) WithTimeout

func (c ASROptionsOpenAI) WithTimeout(timeout time.Duration) common.ASROptions

Jump to

Keyboard shortcuts

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