openai

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginTitle   = "rtp-agent.plugins.openai"
	PluginVersion = "1.5.15"
	PluginPackage = "rtp-agent.plugins.openai"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LiveKitInferenceLLM added in v0.0.15

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

func NewLiveKitInferenceLLM added in v0.0.15

func NewLiveKitInferenceLLM(model string, apiKey, apiSecret string, opts ...LiveKitInferenceLLMOption) (*LiveKitInferenceLLM, error)

func (*LiveKitInferenceLLM) Chat added in v0.0.15

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

func (*LiveKitInferenceLLM) Model added in v0.0.15

func (l *LiveKitInferenceLLM) Model() string

func (*LiveKitInferenceLLM) Provider added in v0.0.15

func (l *LiveKitInferenceLLM) Provider() string

func (*LiveKitInferenceLLM) UpdateOptions added in v0.0.15

func (l *LiveKitInferenceLLM) UpdateOptions(opts ...LiveKitInferenceLLMOption)

type LiveKitInferenceLLMOption added in v0.0.15

type LiveKitInferenceLLMOption func(*LiveKitInferenceLLM)

func WithLiveKitInferenceLLMClass added in v0.0.15

func WithLiveKitInferenceLLMClass(inferenceClass string) LiveKitInferenceLLMOption

func WithLiveKitInferenceLLMExtraParams added in v0.0.15

func WithLiveKitInferenceLLMExtraParams(params map[string]any) LiveKitInferenceLLMOption

func WithLiveKitInferenceLLMModel added in v0.0.15

func WithLiveKitInferenceLLMModel(model string) LiveKitInferenceLLMOption

func WithLiveKitInferenceLLMProvider added in v0.0.15

func WithLiveKitInferenceLLMProvider(provider string) LiveKitInferenceLLMOption

type OpenAILLM

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

func NewAzureOpenAILLM added in v0.0.15

func NewAzureOpenAILLM(model, azureEndpoint, azureDeployment, apiVersion, apiKey, azureADToken string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewCerebrasOpenAILLM added in v0.0.19

func NewCerebrasOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewCometAPIOpenAILLM added in v0.0.19

func NewCometAPIOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewDeepSeekOpenAILLM added in v0.0.19

func NewDeepSeekOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewFireworksOpenAILLM added in v0.0.19

func NewFireworksOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewLettaOpenAILLM added in v0.0.19

func NewLettaOpenAILLM(agentID, baseURL, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewNebiusOpenAILLM added in v0.0.19

func NewNebiusOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewOVHCloudOpenAILLM added in v0.0.19

func NewOVHCloudOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewOctoAIOpenAILLM added in v0.0.19

func NewOctoAIOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewOllamaOpenAILLM added in v0.0.19

func NewOllamaOpenAILLM(model string, opts ...OpenAILLMOption) *OpenAILLM

func NewOpenAILLM

func NewOpenAILLM(apiKey string, model string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewOpenAILLMWithBaseURL

func NewOpenAILLMWithBaseURL(apiKey string, model string, baseURL string, opts ...OpenAILLMOption) *OpenAILLM

func NewOpenAILLMWithBaseURLAndHTTPClient added in v0.0.15

func NewOpenAILLMWithBaseURLAndHTTPClient(apiKey string, model string, baseURL string, httpClient openai.HTTPDoer, opts ...OpenAILLMOption) *OpenAILLM

func NewOpenRouterLLM added in v0.0.15

func NewOpenRouterLLM(apiKey, model string, opts ...OpenRouterLLMOption) (*OpenAILLM, error)

func NewOpenRouterLLMWithHTTPClient added in v0.0.15

func NewOpenRouterLLMWithHTTPClient(apiKey, model string, httpClient openai.HTTPDoer, opts ...OpenRouterLLMOption) (*OpenAILLM, error)

func NewPerplexityOpenAILLM added in v0.0.19

func NewPerplexityOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewSambaNovaOpenAILLM added in v0.0.19

func NewSambaNovaOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewTelnyxOpenAILLM added in v0.0.19

func NewTelnyxOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewTogetherOpenAILLM added in v0.0.19

func NewTogetherOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func NewXAIOpenAILLM added in v0.0.19

func NewXAIOpenAILLM(model, apiKey string, opts ...OpenAILLMOption) (*OpenAILLM, error)

func (*OpenAILLM) Chat

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

func (*OpenAILLM) Model added in v0.0.15

func (l *OpenAILLM) Model() string

func (*OpenAILLM) Provider added in v0.0.15

func (l *OpenAILLM) Provider() string

type OpenAILLMOption added in v0.0.15

type OpenAILLMOption func(*OpenAILLM)

func WithOpenAILLMExtraBody added in v0.0.15

func WithOpenAILLMExtraBody(body map[string]any) OpenAILLMOption

func WithOpenAILLMExtraHeaders added in v0.0.15

func WithOpenAILLMExtraHeaders(headers map[string]string) OpenAILLMOption

func WithOpenAILLMExtraQuery added in v0.0.15

func WithOpenAILLMExtraQuery(query map[string]string) OpenAILLMOption

func WithOpenAILLMMaxCompletionTokens added in v0.0.15

func WithOpenAILLMMaxCompletionTokens(maxCompletionTokens int) OpenAILLMOption

func WithOpenAILLMMetadata added in v0.0.15

func WithOpenAILLMMetadata(metadata map[string]string) OpenAILLMOption

func WithOpenAILLMParallelToolCalls added in v0.0.15

func WithOpenAILLMParallelToolCalls(parallelToolCalls bool) OpenAILLMOption

func WithOpenAILLMPromptCacheKey added in v0.0.15

func WithOpenAILLMPromptCacheKey(promptCacheKey string) OpenAILLMOption

func WithOpenAILLMPromptCacheRetention added in v0.0.15

func WithOpenAILLMPromptCacheRetention(promptCacheRetention string) OpenAILLMOption

func WithOpenAILLMReasoningEffort added in v0.0.15

func WithOpenAILLMReasoningEffort(reasoningEffort string) OpenAILLMOption

func WithOpenAILLMSafetyIdentifier added in v0.0.15

func WithOpenAILLMSafetyIdentifier(safetyIdentifier string) OpenAILLMOption

func WithOpenAILLMServiceTier added in v0.0.15

func WithOpenAILLMServiceTier(serviceTier string) OpenAILLMOption

func WithOpenAILLMStore added in v0.0.15

func WithOpenAILLMStore(store bool) OpenAILLMOption

func WithOpenAILLMStrictToolSchema added in v0.0.19

func WithOpenAILLMStrictToolSchema(strict bool) OpenAILLMOption

func WithOpenAILLMTemperature added in v0.0.15

func WithOpenAILLMTemperature(temperature float64) OpenAILLMOption

func WithOpenAILLMToolChoice added in v0.0.15

func WithOpenAILLMToolChoice(toolChoice llm.ToolChoice) OpenAILLMOption

func WithOpenAILLMTopP added in v0.0.15

func WithOpenAILLMTopP(topP float64) OpenAILLMOption

func WithOpenAILLMUser added in v0.0.15

func WithOpenAILLMUser(user string) OpenAILLMOption

func WithOpenAILLMVerbosity added in v0.0.15

func WithOpenAILLMVerbosity(verbosity string) OpenAILLMOption

type OpenAIRealtimeOption added in v0.0.15

type OpenAIRealtimeOption func(*openAIRealtimeModelOptions)

func WithOpenAIRealtimeBaseURL added in v0.0.15

func WithOpenAIRealtimeBaseURL(baseURL string) OpenAIRealtimeOption

func WithOpenAIRealtimeInputAudioNoiseReduction added in v0.0.15

func WithOpenAIRealtimeInputAudioNoiseReduction(noiseReduction any) OpenAIRealtimeOption

func WithOpenAIRealtimeInputAudioTranscription added in v0.0.15

func WithOpenAIRealtimeInputAudioTranscription(transcription any) OpenAIRealtimeOption

func WithOpenAIRealtimeMaxResponseOutputTokens added in v0.0.15

func WithOpenAIRealtimeMaxResponseOutputTokens(tokens any) OpenAIRealtimeOption

func WithOpenAIRealtimeModalities added in v0.0.15

func WithOpenAIRealtimeModalities(modalities []string) OpenAIRealtimeOption

func WithOpenAIRealtimeSpeed added in v0.0.15

func WithOpenAIRealtimeSpeed(speed float64) OpenAIRealtimeOption

func WithOpenAIRealtimeToolChoice added in v0.0.15

func WithOpenAIRealtimeToolChoice(toolChoice llm.ToolChoice) OpenAIRealtimeOption

func WithOpenAIRealtimeTracing added in v0.0.15

func WithOpenAIRealtimeTracing(tracing any) OpenAIRealtimeOption

func WithOpenAIRealtimeTruncation added in v0.0.15

func WithOpenAIRealtimeTruncation(truncation any) OpenAIRealtimeOption

func WithOpenAIRealtimeTurnDetection added in v0.0.15

func WithOpenAIRealtimeTurnDetection(turnDetection any) OpenAIRealtimeOption

func WithOpenAIRealtimeVoice added in v0.0.15

func WithOpenAIRealtimeVoice(voice string) OpenAIRealtimeOption

type OpenAISTT

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

func NewAzureOpenAISTT added in v0.0.15

func NewAzureOpenAISTT(model, azureEndpoint, azureDeployment, apiVersion, apiKey, azureADToken string, opts ...OpenAISTTOption) (*OpenAISTT, error)

func NewOVHCloudOpenAISTT added in v0.0.19

func NewOVHCloudOpenAISTT(model, apiKey string, opts ...OpenAISTTOption) (*OpenAISTT, error)

func NewOpenAISTT

func NewOpenAISTT(apiKey string, model string, opts ...OpenAISTTOption) (*OpenAISTT, error)

func (*OpenAISTT) Capabilities

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

func (*OpenAISTT) Label

func (s *OpenAISTT) Label() string

func (*OpenAISTT) Model added in v0.0.18

func (s *OpenAISTT) Model() string

func (*OpenAISTT) Provider added in v0.0.15

func (s *OpenAISTT) Provider() string

func (*OpenAISTT) Recognize

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

func (*OpenAISTT) Stream

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

func (*OpenAISTT) UpdateOptions added in v0.0.15

func (s *OpenAISTT) UpdateOptions(opts ...OpenAISTTOption)

type OpenAISTTOption added in v0.0.15

type OpenAISTTOption func(*OpenAISTT)

func WithOpenAISTTBaseURL added in v0.0.15

func WithOpenAISTTBaseURL(baseURL string) OpenAISTTOption

func WithOpenAISTTDetectLanguage added in v0.0.15

func WithOpenAISTTDetectLanguage(detect bool) OpenAISTTOption

func WithOpenAISTTLanguage added in v0.0.15

func WithOpenAISTTLanguage(language string) OpenAISTTOption

func WithOpenAISTTModel added in v0.0.15

func WithOpenAISTTModel(model string) OpenAISTTOption

func WithOpenAISTTNoiseReductionType added in v0.0.15

func WithOpenAISTTNoiseReductionType(noiseReductionType string) OpenAISTTOption

func WithOpenAISTTPrompt added in v0.0.15

func WithOpenAISTTPrompt(prompt string) OpenAISTTOption

func WithOpenAISTTRealtime added in v0.0.15

func WithOpenAISTTRealtime(useRealtime bool) OpenAISTTOption

func WithOpenAISTTTurnDetection added in v0.0.15

func WithOpenAISTTTurnDetection(turnDetection map[string]interface{}) OpenAISTTOption

type OpenAITTS

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

func NewAzureOpenAITTS added in v0.0.15

func NewAzureOpenAITTS(model openai.SpeechModel, voice openai.SpeechVoice, azureEndpoint, azureDeployment, apiVersion, apiKey, azureADToken string, opts ...OpenAITTSOption) (*OpenAITTS, error)

func NewOpenAITTS

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

func (*OpenAITTS) Capabilities

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

func (*OpenAITTS) Label

func (t *OpenAITTS) Label() string

func (*OpenAITTS) Model added in v0.0.18

func (t *OpenAITTS) Model() string

func (*OpenAITTS) NumChannels

func (t *OpenAITTS) NumChannels() int

func (*OpenAITTS) Provider added in v0.0.15

func (t *OpenAITTS) Provider() string

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)

func (*OpenAITTS) UpdateOptions added in v0.0.15

func (t *OpenAITTS) UpdateOptions(opts ...OpenAITTSOption)

type OpenAITTSOption added in v0.0.15

type OpenAITTSOption func(*OpenAITTS)

func WithOpenAITTSBaseURL added in v0.0.15

func WithOpenAITTSBaseURL(baseURL string) OpenAITTSOption

func WithOpenAITTSInstructions added in v0.0.15

func WithOpenAITTSInstructions(instructions string) OpenAITTSOption

func WithOpenAITTSModel added in v0.0.15

func WithOpenAITTSModel(model openai.SpeechModel) OpenAITTSOption

func WithOpenAITTSResponseFormat added in v0.0.15

func WithOpenAITTSResponseFormat(format openai.SpeechResponseFormat) OpenAITTSOption

func WithOpenAITTSSpeed added in v0.0.15

func WithOpenAITTSSpeed(speed float64) OpenAITTSOption

func WithOpenAITTSVoice added in v0.0.15

func WithOpenAITTSVoice(voice openai.SpeechVoice) OpenAITTSOption

type OpenRouterLLMOption added in v0.0.15

type OpenRouterLLMOption func(*openRouterLLMOptions)

func WithOpenRouterAppName added in v0.0.15

func WithOpenRouterAppName(appName string) OpenRouterLLMOption

func WithOpenRouterFallbackModels added in v0.0.15

func WithOpenRouterFallbackModels(models []string) OpenRouterLLMOption

func WithOpenRouterLLMOptions added in v0.0.15

func WithOpenRouterLLMOptions(opts ...OpenAILLMOption) OpenRouterLLMOption

func WithOpenRouterPlugins added in v0.0.15

func WithOpenRouterPlugins(plugins []map[string]any) OpenRouterLLMOption

func WithOpenRouterProvider added in v0.0.15

func WithOpenRouterProvider(provider map[string]any) OpenRouterLLMOption

func WithOpenRouterSiteURL added in v0.0.15

func WithOpenRouterSiteURL(siteURL string) OpenRouterLLMOption

type RealtimeModel

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

func NewRealtimeModel

func NewRealtimeModel(apiKey, model string, opts ...OpenAIRealtimeOption) *RealtimeModel

func (*RealtimeModel) Capabilities added in v0.0.15

func (m *RealtimeModel) Capabilities() llm.RealtimeCapabilities

func (*RealtimeModel) Close added in v0.0.15

func (m *RealtimeModel) Close() error

func (*RealtimeModel) Model added in v0.0.15

func (m *RealtimeModel) Model() string

func (*RealtimeModel) Provider added in v0.0.15

func (m *RealtimeModel) Provider() string

func (*RealtimeModel) Session

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

func (*RealtimeModel) UpdateOptions added in v0.0.15

func (m *RealtimeModel) UpdateOptions(options llm.RealtimeSessionOptions) error

Jump to

Keyboard shortcuts

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