tzapconnect

package module
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadOPENAI_API_KEY added in v0.9.3

func LoadOPENAI_API_KEY() (string, error)

func WithConfig

func WithConfig(openai_apikey string, conf config.Configuration) types.TzapConnector

Types

type PartialComposite

type PartialComposite struct {
	*types.UnimplementedTGenerator
	OpenaiTgenerator *openaiconnector.OpenaiTgenerator
	VoiceGenerator   types.TGenerator
}

func (PartialComposite) AddEmbeddingDocument added in v0.7.12

func (pc PartialComposite) AddEmbeddingDocument(ctx context.Context, docID string, embedding [1536]float32, metadata types.Metadata) error

func (PartialComposite) CountTokens

func (pc PartialComposite) CountTokens(ctx context.Context, content string) (int, error)

func (PartialComposite) DeleteEmbeddingDocument added in v0.7.12

func (pc PartialComposite) DeleteEmbeddingDocument(ctx context.Context, docID string) error

func (PartialComposite) DeleteEmbeddingDocuments added in v0.9.3

func (pc PartialComposite) DeleteEmbeddingDocuments(ctx context.Context, ids []string) error

func (PartialComposite) FetchEmbedding added in v0.7.12

func (pc PartialComposite) FetchEmbedding(ctx context.Context, content ...string) ([][1536]float32, error)

func (PartialComposite) GenerateChat

func (pc PartialComposite) GenerateChat(ctx context.Context, messages []types.Message, stream bool, functions string) (types.CompletionMessage, error)

func (PartialComposite) GetEmbeddingDocument added in v0.7.12

func (pc PartialComposite) GetEmbeddingDocument(ctx context.Context, docID string) (types.Vector, bool, error)

func (PartialComposite) ListAllEmbeddingsIds added in v0.7.12

func (pc PartialComposite) ListAllEmbeddingsIds(ctx context.Context) (types.SearchResults, error)

func (PartialComposite) OffsetTokens

func (pc PartialComposite) OffsetTokens(ctx context.Context, content string, from int, to int) (string, int, error)

func (PartialComposite) SearchWithEmbedding added in v0.7.12

func (pc PartialComposite) SearchWithEmbedding(ctx context.Context, embedding types.QueryFilter, k int) (types.SearchResults, error)

func (PartialComposite) TextToSpeech

func (pc PartialComposite) TextToSpeech(ctx context.Context, content, language, voice string) (*[]byte, error)

Jump to

Keyboard shortcuts

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