openai

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

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) Close added in v0.1.0

func (l *OpenAILLM) Close() 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 WithOpenAILLMAzureADTokenProvider added in v0.1.2

func WithOpenAILLMAzureADTokenProvider(provider func(context.Context) (string, error)) OpenAILLMOption

func WithOpenAILLMAzureBaseURL added in v0.1.2

func WithOpenAILLMAzureBaseURL(baseURL string) OpenAILLMOption

func WithOpenAILLMAzureTimeout added in v0.1.2

func WithOpenAILLMAzureTimeout(timeout time.Duration) OpenAILLMOption

func WithOpenAILLMDefaultReasoning added in v0.1.0

func WithOpenAILLMDefaultReasoning(defaultReasoning bool) OpenAILLMOption

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 WithOpenAILLMExtraParams added in v0.1.0

func WithOpenAILLMExtraParams(params map[string]any) 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 WithOpenAILLMMaxRetries added in v0.1.3

func WithOpenAILLMMaxRetries(maxRetries int) OpenAILLMOption

func WithOpenAILLMMetadata added in v0.0.15

func WithOpenAILLMMetadata(metadata map[string]string) OpenAILLMOption

func WithOpenAILLMOrganization added in v0.1.2

func WithOpenAILLMOrganization(organization string) OpenAILLMOption

func WithOpenAILLMParallelToolCalls added in v0.0.15

func WithOpenAILLMParallelToolCalls(parallelToolCalls bool) OpenAILLMOption

func WithOpenAILLMProject added in v0.1.2

func WithOpenAILLMProject(project string) 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 WithOpenAILLMReasoning added in v0.1.2

func WithOpenAILLMReasoning(reasoning map[string]any) 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 WithOpenAILLMTimeout added in v0.1.3

func WithOpenAILLMTimeout(timeout time.Duration) 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 OpenAIRealtimeFunctionCallFilter added in v0.1.0

type OpenAIRealtimeFunctionCallFilter func([]llm.Tool, string) bool

type OpenAIRealtimeInputTranscriptionFinalHook added in v0.1.0

type OpenAIRealtimeInputTranscriptionFinalHook func(*llm.ChatMessage, *llm.InputTranscriptionCompleted)

type OpenAIRealtimeOption added in v0.0.15

type OpenAIRealtimeOption func(*openAIRealtimeModelOptions)

func WithOpenAIRealtimeBaseURL added in v0.0.15

func WithOpenAIRealtimeBaseURL(baseURL string) OpenAIRealtimeOption

func WithOpenAIRealtimeConnectOptions added in v0.1.0

func WithOpenAIRealtimeConnectOptions(connectOptions llm.APIConnectOptions) OpenAIRealtimeOption

func WithOpenAIRealtimeFunctionCallFilter added in v0.1.0

func WithOpenAIRealtimeFunctionCallFilter(filter OpenAIRealtimeFunctionCallFilter) 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 WithOpenAIRealtimeInputTranscriptionFinalHook added in v0.1.0

func WithOpenAIRealtimeInputTranscriptionFinalHook(hook OpenAIRealtimeInputTranscriptionFinalHook) OpenAIRealtimeOption

func WithOpenAIRealtimeMaxResponseOutputTokens added in v0.0.15

func WithOpenAIRealtimeMaxResponseOutputTokens(tokens any) OpenAIRealtimeOption

func WithOpenAIRealtimeMaxSessionDuration added in v0.1.0

func WithOpenAIRealtimeMaxSessionDuration(duration time.Duration) OpenAIRealtimeOption

func WithOpenAIRealtimeModalities added in v0.0.15

func WithOpenAIRealtimeModalities(modalities []string) OpenAIRealtimeOption

func WithOpenAIRealtimeReasoning added in v0.1.0

func WithOpenAIRealtimeReasoning(reasoning any) OpenAIRealtimeOption

func WithOpenAIRealtimeRemoteItemAddedHook added in v0.1.0

func WithOpenAIRealtimeRemoteItemAddedHook(hook OpenAIRealtimeRemoteItemAddedHook) OpenAIRealtimeOption

func WithOpenAIRealtimeSessionCloseMetricsHook added in v0.1.0

func WithOpenAIRealtimeSessionCloseMetricsHook(hook OpenAIRealtimeSessionCloseMetricsHook) 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 WithOpenAIRealtimeToolFormatter added in v0.1.0

func WithOpenAIRealtimeToolFormatter(formatter OpenAIRealtimeToolFormatter) 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

func WithOpenAIRealtimeWebsocketDialer added in v0.1.0

func WithOpenAIRealtimeWebsocketDialer(dialer OpenAIRealtimeWebsocketDialer) OpenAIRealtimeOption

type OpenAIRealtimeRemoteItemAddedHook added in v0.1.0

type OpenAIRealtimeRemoteItemAddedHook func(*llm.RemoteChatContext, *llm.RemoteItemAddedEvent)

type OpenAIRealtimeSessionCloseMetricsHook added in v0.1.0

type OpenAIRealtimeSessionCloseMetricsHook func(time.Duration) *telemetry.RealtimeModelMetrics

type OpenAIRealtimeToolFormatter added in v0.1.0

type OpenAIRealtimeToolFormatter func([]llm.Tool) []map[string]any

type OpenAIRealtimeWebsocketDialer added in v0.1.0

type OpenAIRealtimeWebsocketDialer func(string, http.Header) (*websocket.Conn, *http.Response, error)

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) Close added in v0.1.0

func (s *OpenAISTT) Close() error

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 WithOpenAISTTAzureADTokenProvider added in v0.1.4

func WithOpenAISTTAzureADTokenProvider(provider func(context.Context) (string, error)) OpenAISTTOption

func WithOpenAISTTBaseURL added in v0.0.15

func WithOpenAISTTBaseURL(baseURL string) OpenAISTTOption

func WithOpenAISTTConnectOptions added in v0.1.0

func WithOpenAISTTConnectOptions(connectOptions llm.APIConnectOptions) OpenAISTTOption

func WithOpenAISTTDetectLanguage added in v0.0.15

func WithOpenAISTTDetectLanguage(detect bool) OpenAISTTOption

func WithOpenAISTTHTTPClient added in v0.1.3

func WithOpenAISTTHTTPClient(client openai.HTTPDoer) 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 WithOpenAISTTOrganization added in v0.1.4

func WithOpenAISTTOrganization(organization string) OpenAISTTOption

func WithOpenAISTTProject added in v0.1.4

func WithOpenAISTTProject(project 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

func WithOpenAISTTVAD added in v0.1.0

func WithOpenAISTTVAD(v vad.VAD) OpenAISTTOption

type OpenAITTS

type OpenAITTS struct {
	tts.MetricsEmitter
	// 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) Close added in v0.1.0

func (t *OpenAITTS) Close() error

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) Prewarm added in v0.1.0

func (t *OpenAITTS) Prewarm()

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 WithOpenAITTSAzureADTokenProvider added in v0.1.4

func WithOpenAITTSAzureADTokenProvider(provider func(context.Context) (string, error)) OpenAITTSOption

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 WithOpenAITTSOrganization added in v0.1.4

func WithOpenAITTSOrganization(organization string) OpenAITTSOption

func WithOpenAITTSProject added in v0.1.4

func WithOpenAITTSProject(project string) 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 NewAzureOpenAIRealtimeModel added in v0.1.0

func NewAzureOpenAIRealtimeModel(model, azureEndpoint, azureDeployment, apiVersion, apiKey, azureADToken string, opts ...OpenAIRealtimeOption) (*RealtimeModel, error)

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