openai

package
v0.0.0-...-3e3f95b Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Completer

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

func NewCompleter

func NewCompleter(url, model string, 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
}

func (*Config) Options

func (c *Config) Options() []option.RequestOption

type Embedder

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

func NewEmbedder

func NewEmbedder(url, model string, options ...Option) (*Embedder, error)

func (*Embedder) Embed

func (e *Embedder) Embed(ctx context.Context, texts []string) (*provider.Embedding, error)

type Option

type Option func(*Config)

func WithClient

func WithClient(client *http.Client) Option

func WithToken

func WithToken(token string) Option

type Renderer

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

func NewRenderer

func NewRenderer(url, model string, options ...Option) (*Renderer, error)

func (*Renderer) Render

func (r *Renderer) Render(ctx context.Context, input string, options *provider.RenderOptions) (*provider.Image, error)

type Synthesizer

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

func NewSynthesizer

func NewSynthesizer(url, model string, 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(url, model string, 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