Documentation
¶
Index ¶
- type Embeddings
- type ITzap
- type KeyValue
- type MappedInterface
- type Message
- type NamedWorkflow
- type Query
- type QueryFilter
- type QueryJson
- type QueryRequest
- type SearchResults
- type TGenerator
- type TzapConnector
- type UnimplementedTGenerator
- func (UnimplementedTGenerator) GenerateChat(ctx context.Context, messages []Message, stream bool) (string, error)
- func (UnimplementedTGenerator) SpeechToText(ctx context.Context, audioContent *[]byte, language string) (string, error)
- func (UnimplementedTGenerator) TextToSpeech(ctx context.Context, content, language, voice string) (*[]byte, error)
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Embeddings ¶ added in v0.7.12
type Embeddings struct {
Vectors []Vector `json:"vectors"`
}
type ITzap ¶
type ITzap[T any, Z any] interface { AddUserMessage(contents ...string) T AddAssistantMessage(contents ...string) T AddSystemMessage(contents ...string) T SetInitialSystemContent(content string) T LoadFileDir(dir string) T LoadFiles(filepaths []string) T ChangeFilepath(filepath string) T LoadCompletion(filepath string) T LoadCompletionOrRequestCompletionMD5(filePath string) T LoadCompletionOrRequestCompletion(filepath string) T RequestChatCompletion() T StoreCompletion(filePath string) T RequestTextToSpeech(language, voice string) T //Tzap Primitives New() T AddTzap(tc T) T HijackTzap(tc T) T CloneTzap(tc T) T //ControlFlow WorkTzap(fn func(t T)) T IsolatedTzap(fn func(t T)) T MutationTzap(fn func(t T) T) T Map(func(t T) T) T Accumulate(func(t T) T) T Exit() T ApplyWorkflow(nt NamedWorkflow[T, Z]) T ApplyErrorWorkflow(nt NamedWorkflow[T, Z], fn func(t Z) error) T ApplyWorkflowFN(nt func(t T) T) T ApplyWorkflowP(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 CountTokens(content string) (int, error) OffsetTokens(content string, from int, to int) (string, error) }
type MappedInterface ¶
type MappedInterface map[string]interface{}
type NamedWorkflow ¶ added in v0.7.14
type QueryFilter ¶ added in v0.7.12
type QueryRequest ¶ added in v0.7.12
type QueryRequest struct {
TopK int `json:"topK"`
IncludeMetadata bool `json:"includeMetadata"`
Namespace string `json:"namespace"`
Queries []QueryFilter `json:"queries"`
}
type SearchResults ¶ added in v0.7.12
type SearchResults struct {
Results []Vector
}
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)
FetchEmbedding(ctx context.Context, content ...string) ([][]float32, error)
AddEmbeddingDocument(ctx context.Context, id string, embedding []float32, metadata map[string]string) error
GetEmbeddingDocument(ctx context.Context, id string) (Vector, bool, error)
DeleteEmbeddingDocument(ctx context.Context, id string) error
DeleteEmbeddingDocuments(ctx context.Context, ids []string) error
SearchWithEmbedding(ctx context.Context, embedding QueryFilter, k int) (SearchResults, error)
ListAllEmbeddingsIds(ctx context.Context) (SearchResults, 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, int, error)
RawTokens(ctx context.Context, content string) ([]string, error)
}
type TzapConnector ¶
type TzapConnector func() (TGenerator, config.Configuration)
type UnimplementedTGenerator ¶
type UnimplementedTGenerator struct {
TGenerator
}
func (UnimplementedTGenerator) GenerateChat ¶
func (UnimplementedTGenerator) SpeechToText ¶
func (UnimplementedTGenerator) TextToSpeech ¶
Click to show internal directories.
Click to hide internal directories.