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) 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.