provider

package
v0.0.0-...-1f01b20 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompleteOptions

type CompleteOptions struct {
	Stream chan<- Completion

	Stop      []string
	Functions []Function

	MaxTokens   *int
	Temperature *float32

	Format CompletionFormat
}

type Completer

type Completer interface {
	Complete(ctx context.Context, messages []Message, options *CompleteOptions) (*Completion, error)
}

type Completion

type Completion struct {
	ID string

	Reason CompletionReason

	Message Message
}

type CompletionFormat

type CompletionFormat string
const (
	CompletionFormatJSON CompletionFormat = "json"
)

type CompletionReason

type CompletionReason string
const (
	CompletionReasonStop     CompletionReason = "stop"
	CompletionReasonLength   CompletionReason = "length"
	CompletionReasonFunction CompletionReason = "function"
)

type Embedder

type Embedder interface {
	Embed(ctx context.Context, content string) (Embeddings, error)
}

type Embeddings

type Embeddings []float32

type File

type File struct {
	ID string

	Name    string
	Content io.Reader
}

type Function

type Function struct {
	Name        string
	Description string

	Parameters jsonschema.Definition
}

type FunctionCall

type FunctionCall struct {
	ID string

	Name      string
	Arguments string
}

type Image

type Image struct {
	ID string

	Name    string
	Content io.ReadCloser
}

type Message

type Message struct {
	Role    MessageRole
	Content string

	Files []File

	Function      string
	FunctionCalls []FunctionCall
}

type MessageRole

type MessageRole string
const (
	MessageRoleSystem    MessageRole = "system"
	MessageRoleUser      MessageRole = "user"
	MessageRoleAssistant MessageRole = "assistant"
	MessageRoleFunction  MessageRole = "function"
)

type Model

type Model struct {
	ID string
}

type RenderOptions

type RenderOptions struct {
}

type Renderer

type Renderer interface {
	Render(ctx context.Context, input string, options *RenderOptions) (*Image, error)
}

type Synthesis

type Synthesis struct {
	ID string

	Name    string
	Content io.ReadCloser
}

type SynthesizeOptions

type SynthesizeOptions struct {
	Voice string
}

type Synthesizer

type Synthesizer interface {
	Synthesize(ctx context.Context, content string, options *SynthesizeOptions) (*Synthesis, error)
}

type TranscribeOptions

type TranscribeOptions struct {
	Language    string
	Temperature *float32
}

type Transcriber

type Transcriber interface {
	Transcribe(ctx context.Context, input File, options *TranscribeOptions) (*Transcription, error)
}

type Transcription

type Transcription struct {
	ID string

	Language string
	Duration float64

	Content string
}

type TranslateOptions

type TranslateOptions struct {
	Language string
}

type Translation

type Translation struct {
	ID string

	Content string
}

type Translator

type Translator interface {
	Translate(ctx context.Context, content string, options *TranslateOptions) (*Translation, error)
}

Jump to

Keyboard shortcuts

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