client

package
v0.0.0-...-fa30edc Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatGPT

type ChatGPT struct {
	Token string
	Model string
}

func NewChatGPT

func NewChatGPT(token string) *ChatGPT

func (*ChatGPT) Completion

func (c *ChatGPT) Completion(ctx context.Context, prompt Prompt) (io.Reader, error)

func (*ChatGPT) CreateAudio

func (c *ChatGPT) CreateAudio(ctx context.Context, text string) ([]byte, error)

func (*ChatGPT) CreateImage

func (c *ChatGPT) CreateImage(ctx context.Context, prompt string) ([]byte, error)

func (*ChatGPT) CreateTranscript

func (c *ChatGPT) CreateTranscript(ctx context.Context, audio []byte) (string, error)

type Dummy

type Dummy struct {
	Failure error
	P       Prompt
	// contains filtered or unexported fields
}

--- Dummy Client

func NewDummyClient

func NewDummyClient(fixedResponse string, err error) *Dummy

func (*Dummy) Completion

func (d *Dummy) Completion(ctx context.Context, prompt Prompt) (io.Reader, error)

type Ollama

type Ollama struct {
	Model    string
	Endpoint string
}

func NewOllama

func NewOllama(model string, endpoint string) *Ollama

func (*Ollama) Completion

func (o *Ollama) Completion(ctx context.Context, prompt Prompt) (io.Reader, error)

func (*Ollama) GenerateEmbedding

func (o *Ollama) GenerateEmbedding(ctx context.Context, prompt Prompt) ([]float64, error)

type Prompt

type Prompt interface {
	GetPurpose() string
	GetHistory() ([]string, []string)
	GetQuestion() string
	GetReferences() [][]byte
}

--- Prompts and Messages

type Vertex

type Vertex struct {
	Token     string
	ProjectID string
}

func NewVertex

func NewVertex() *Vertex

func (*Vertex) Completion

func (v *Vertex) Completion(ctx context.Context, prompt Prompt) (io.Reader, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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