types

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: MIT Imports: 2 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITzap

type ITzap[T any] interface {
	//
	AddUserMessage(contents ...string) T
	AddAssistantMessage(contents ...string) T
	AddSystemMessage(contents ...string) T
	SetHeader(header string) T

	LoadFileDir(dir string, ext string) T
	ChangeFilepath(filepath string) T
	FetchTask() T

	LoadTask(filepath string) T
	LoadTaskOrRequestNewTask(filepath string) T
	LoadTaskOrRequestNewTaskMD5(filepath string) T

	RequestChat() T
	RequestTextToSpeech(language, voice string) T

	//Tzap Primitives
	New() T
	AddTzap(tc T) T
	HijackTzap(tc T) T

	//ControlFlow
	BubbleTzap(fn func(t T)) T
	IsolatedTzap(fn func(t T)) T
	MutationTzap(fn func(t T) T) T
	Map(func(T) T) T
	Accumulate(func(T) T) T
	Exit() T

	//ApplyTemplate(template T) T
	ApplyTemplateFN(nt func(T) T) T
	ApplyTemplate2(nt NamedTemplate[T]) T

	Recursive(func(tzapThatCreatesNewChildren T) T) T
	CheckAndHandleGlobalOccurrences(references int, filename string, noOccurrence, handleOccurrence func(T) T) T
	CheckAndHandleRecurrences(references int, filename string, noReccurance, handleRecurrence func(T) T) T
	FileMustContainHandleGlobalOccurrences(references int, filename string, noOccurrence, handleOccurrence func(T) T) T
}

type MappedInterface

type MappedInterface map[string]interface{}

type Message

type Message struct {
	Role    string
	Content string
}

type NamedTemplate

type NamedTemplate[T any] struct {
	Name     string
	Template func(T) T // Assuming the function takes no arguments and returns no values
}

type TGenerator

type TGenerator interface {
	TextToSpeech(ctx context.Context, content, language, voice string) (*[]byte, error)
	SpeechToText(ctx context.Context, audioContent *[]byte, language string) (string, error)
	GenerateChat(ctx context.Context, messages []Message, stream bool) (string, error)
	CountTokens(ctx context.Context, content string) (int, error)
	OffsetTokens(ctx context.Context, content string, from int, to int) (string, error)
}

type TzapConnector

type TzapConnector func() (TGenerator, config.Configuration)

type UnimplementedTGenerator

type UnimplementedTGenerator struct {
	TGenerator
}

func (UnimplementedTGenerator) GenerateChat

func (UnimplementedTGenerator) GenerateChat(ctx context.Context, messages []Message, stream bool) (string, error)

func (UnimplementedTGenerator) SpeechToText

func (UnimplementedTGenerator) SpeechToText(ctx context.Context, audioContent *[]byte, language string) (string, error)

func (UnimplementedTGenerator) TextToSpeech

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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