openai

package
v0.0.0-...-8699900 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*Embedder
	*Completer
	*Synthesizer
	*Transcriber
}

func New

func New(options ...Option) (*Client, error)

type Completer

type Completer struct {
	*Config
	// contains filtered or unexported fields
}

func NewCompleter

func NewCompleter(options ...Option) (*Completer, error)

func (*Completer) Complete

func (c *Completer) Complete(ctx context.Context, messages []provider.Message, options *provider.CompleteOptions) (*provider.Completion, error)

type Config

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

type Embedder

type Embedder struct {
	*Config
	// contains filtered or unexported fields
}

func NewEmbedder

func NewEmbedder(options ...Option) (*Embedder, error)

func (*Embedder) Embed

func (c *Embedder) Embed(ctx context.Context, content string) ([]float32, error)

type Option

type Option func(*Config)

func WithClient

func WithClient(client *http.Client) Option

func WithModel

func WithModel(model string) Option

func WithToken

func WithToken(token string) Option

func WithURL

func WithURL(url string) Option

type Synthesizer

type Synthesizer struct {
	*Config
	// contains filtered or unexported fields
}

func NewSynthesizer

func NewSynthesizer(options ...Option) (*Synthesizer, error)

func (*Synthesizer) Synthesize

func (s *Synthesizer) Synthesize(ctx context.Context, content string, options *provider.SynthesizeOptions) (*provider.Synthesis, error)

type Transcriber

type Transcriber struct {
	*Config
	// contains filtered or unexported fields
}

func NewTranscriber

func NewTranscriber(options ...Option) (*Transcriber, error)

func (*Transcriber) Transcribe

Jump to

Keyboard shortcuts

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