openai

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAILLM

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

func NewOpenAILLM

func NewOpenAILLM(apiKey string, model string) *OpenAILLM

func NewOpenAILLMWithBaseURL

func NewOpenAILLMWithBaseURL(apiKey string, model string, baseURL string) *OpenAILLM

func NewOpenAILLMWithConfig

func NewOpenAILLMWithConfig(config openai.ClientConfig) *OpenAILLM

func (*OpenAILLM) Chat

func (l *OpenAILLM) Chat(ctx context.Context, chatCtx *llm.ChatContext, opts ...llm.ChatOption) (llm.LLMStream, error)

func (*OpenAILLM) RawClient

func (l *OpenAILLM) RawClient() *openai.Client

type OpenAISTT

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

func NewOpenAISTT

func NewOpenAISTT(apiKey string, model string) *OpenAISTT

func NewOpenAISTTWithBaseURL added in v0.0.6

func NewOpenAISTTWithBaseURL(apiKey string, model string, baseURL string) *OpenAISTT

func NewOpenAISTTWithPrompt added in v0.0.6

func NewOpenAISTTWithPrompt(apiKey string, model string, baseURL string, prompt string) *OpenAISTT

func (*OpenAISTT) Capabilities

func (s *OpenAISTT) Capabilities() stt.STTCapabilities

func (*OpenAISTT) Label

func (s *OpenAISTT) Label() string

func (*OpenAISTT) Recognize

func (s *OpenAISTT) Recognize(ctx context.Context, frames []*model.AudioFrame, language string) (*stt.SpeechEvent, error)

func (*OpenAISTT) SetLanguage added in v0.0.9

func (s *OpenAISTT) SetLanguage(lang string)

func (*OpenAISTT) Stream

func (s *OpenAISTT) Stream(ctx context.Context, language string) (stt.RecognizeStream, error)

type OpenAITTS

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

func NewOpenAITTS

func NewOpenAITTS(apiKey string, model openai.SpeechModel, voice openai.SpeechVoice, opts ...OpenAITTSOptions) *OpenAITTS

func (*OpenAITTS) Capabilities

func (t *OpenAITTS) Capabilities() tts.TTSCapabilities

func (*OpenAITTS) Label

func (t *OpenAITTS) Label() string

func (*OpenAITTS) NumChannels

func (t *OpenAITTS) NumChannels() int

func (*OpenAITTS) SampleRate

func (t *OpenAITTS) SampleRate() int

func (*OpenAITTS) Stream

func (t *OpenAITTS) Stream(ctx context.Context) (tts.SynthesizeStream, error)

func (*OpenAITTS) Synthesize

func (t *OpenAITTS) Synthesize(ctx context.Context, text string) (tts.ChunkedStream, error)

type OpenAITTSOptions added in v0.0.5

type OpenAITTSOptions struct {
	SampleRate int
}

type RealtimeModel

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

func NewRealtimeModel

func NewRealtimeModel(apiKey, model string) *RealtimeModel

func (*RealtimeModel) Session

func (m *RealtimeModel) Session() (llm.RealtimeSession, error)

type SpeechModel added in v0.0.9

type SpeechModel = openai.SpeechModel

type SpeechVoice added in v0.0.9

type SpeechVoice = openai.SpeechVoice

Jump to

Keyboard shortcuts

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