openaiprovider

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenAITextToEmbeddingDefaultModel = openai.LargeEmbedding3
	OpenAITextToEmbeddingFastModel    = openai.SmallEmbedding3
)
View Source
const (
	OpenAITextToJSONDefaultModel     = openai.GPT4o
	OpenAITextToJSONDefaultModelFast = openai.GPT4o
)
View Source
const (
	OpenAITextToTextReasoningDefaultModel     = openai.O1Preview
	OpenAITextToTextReasoningDefaultModelFast = openai.O1Mini
)
View Source
const (
	OpenAITextToTextDefaultModel     = openai.GPT4o
	OpenAITextToTextDefaultModelFast = openai.GPT4o
)
View Source
const (
	OpenAITextToSpeechDefaultModel = openai.TTSModel1
)

Variables

This section is empty.

Functions

func NewOAIProviderConfig

func NewOAIProviderConfig(apiKey, model string) oaiProviderConfig

func NewTextToJSONProvider added in v0.2.0

func NewTextToJSONProvider(
	config oaiProviderConfig,
) (baseprovider.TextToJSONProvider, error)

func NewTextToSpeechProvider added in v0.2.3

func NewTextToSpeechProvider(
	config oaiProviderConfig,
) (baseprovider.TextToSpeechProvider, error)

func NewTextToTextProvider

func NewTextToTextProvider(
	config oaiProviderConfig,
) (baseprovider.TextToTextProvider, error)

func NewTextToTextReasoningProvider

func NewTextToTextReasoningProvider(
	config oaiProviderConfig,
) (baseprovider.TextToTextReasoningProvider, error)

Types

type TextToEmbeddingProvider added in v0.3.2

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

func NewTextToEmbeddingProvider added in v0.3.2

func NewTextToEmbeddingProvider(
	config oaiProviderConfig,
) (TextToEmbeddingProvider, error)

func (TextToEmbeddingProvider) Close added in v0.3.2

func (p TextToEmbeddingProvider) Close() error

func (TextToEmbeddingProvider) GenerateEmbedding added in v0.3.2

func (p TextToEmbeddingProvider) GenerateEmbedding(
	ctx context.Context,
	message string,
) ([]float32, error)

func (TextToEmbeddingProvider) GetModel added in v0.3.2

func (p TextToEmbeddingProvider) GetModel() string

For now, we are always using the default model

type TextToJSONProvider added in v0.2.0

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

func (TextToJSONProvider) Close added in v0.2.0

func (p TextToJSONProvider) Close() error

func (TextToJSONProvider) GenerateCompletion added in v0.2.0

func (p TextToJSONProvider) GenerateCompletion(
	ctx context.Context,
	messages []chat.Message,
	completionCh chan<- completion.Completion,
) error

func (TextToJSONProvider) GetModel added in v0.2.0

func (p TextToJSONProvider) GetModel() string

type TextToSpeechProvider added in v0.2.3

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

func (TextToSpeechProvider) Close added in v0.2.3

func (p TextToSpeechProvider) Close() error

func (TextToSpeechProvider) GenerateSpeech added in v0.2.3

func (p TextToSpeechProvider) GenerateSpeech(
	ctx context.Context,
	message string,
) ([]byte, error)

func (TextToSpeechProvider) GetModel added in v0.2.3

func (p TextToSpeechProvider) GetModel() string

For now, we are always using the default model

type TextToTextProvider

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

func (TextToTextProvider) Close

func (p TextToTextProvider) Close() error

func (TextToTextProvider) GenerateCompletion

func (p TextToTextProvider) GenerateCompletion(
	ctx context.Context,
	messages []chat.Message,
	completionCh chan<- completion.Completion,
) error

func (TextToTextProvider) GetModel

func (p TextToTextProvider) GetModel() string

type TextToTextReasoningProvider

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

func (*TextToTextReasoningProvider) Close

func (*TextToTextReasoningProvider) GenerateCompletion

func (p *TextToTextReasoningProvider) GenerateCompletion(
	ctx context.Context,
	messages []chat.Message,
	completionCh chan<- completion.Completion,
) error

func (*TextToTextReasoningProvider) GetModel

func (p *TextToTextReasoningProvider) GetModel() string

Jump to

Keyboard shortcuts

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