documentloaders

package
v0.0.0-...-e7b49d2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TranscribeAudioResponse

type TranscribeAudioResponse struct {
	Text string `json:"text"`
}

TranscribeAudioResponse represents the JSON response from the transcription API.

type WhisperOpenAILoader

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

WhisperOpenAILoader is a struct for loading and transcribing audio files using Whisper OpenAI model.

func NewWhisperOpenAI

func NewWhisperOpenAI(apiKey string, opts ...WhisperOpenAIOption) *WhisperOpenAILoader

NewWhisperOpenAI creates a new WhisperOpenAILoader with given API key and options.

func (*WhisperOpenAILoader) Load

func (*WhisperOpenAILoader) LoadAndSplit

func (c *WhisperOpenAILoader) LoadAndSplit(ctx context.Context, splitter textsplitter.TextSplitter) ([]schema.Document, error)

type WhisperOpenAIOption

type WhisperOpenAIOption func(loader *WhisperOpenAILoader)

WhisperOpenAIOption defines a function type for configuring WhisperOpenAILoader.

func WithAudioPath

func WithAudioPath(path string) WhisperOpenAIOption

WithAudioPath sets the audio file path for the WhisperOpenAILoader.

func WithLangsmithParentId

func WithLangsmithParentId(parentId string) WhisperOpenAIOption

WithLangsmithParentId sets the parent id for langsmith.

func WithLanguage

func WithLanguage(language string) WhisperOpenAIOption

WithLanguage allows setting a custom language. doc for language: https://platform.openai.com/docs/guides/speech-to-text/supported-languages

func WithModel

func WithModel(model string) WhisperOpenAIOption

WithModel sets the model for the WhisperOpenAILoader.

func WithTemperature

func WithTemperature(temperature float64) WhisperOpenAIOption

WithTemperature sets the transcription temperature for the WhisperOpenAILoader.

Jump to

Keyboard shortcuts

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