friday

package
v0.0.0-...-f03bf9e Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultTopK = 6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatState

type ChatState struct {
	Response chan map[string]string // dialogue result for chat
	Answer   string                 // answer result for question
	Tokens   map[string]int
}

type Friday

type Friday struct {
	Log   logger.Logger
	Error error

	LimitToken int

	LLM     llm.LLM
	Prompts map[string]string

	Embedding embedding.Embedding

	Vector     vectorstore.VectorStore
	VectorTopK *int

	Spliter spliter.Spliter
	// contains filtered or unexported fields
}
var (
	Fri *Friday
)

func (*Friday) Chat

func (f *Friday) Chat(res *ChatState) *Friday

func (*Friday) ChatConclusion

func (f *Friday) ChatConclusion(ctx context.Context, chat string) (string, map[string]int, error)

func (*Friday) ChatConclusionFromElementFile

func (f *Friday) ChatConclusionFromElementFile(ctx context.Context, chatFile string) (string, map[string]int, error)

func (*Friday) ChatConclusionFromFile

func (f *Friday) ChatConclusionFromFile(ctx context.Context, chatFile string) (string, map[string]int, error)

func (*Friday) Complete

func (f *Friday) Complete(res *ChatState) *Friday

func (*Friday) Content

func (f *Friday) Content(content string) *Friday

func (*Friday) Element

func (f *Friday) Element(elements []models.Element) *Friday

func (*Friday) ElementFile

func (f *Friday) ElementFile(ps *string) *Friday

func (*Friday) File

func (f *Friday) File(file *models.File) *Friday

func (*Friday) GetRealHistory

func (f *Friday) GetRealHistory() []map[string]string

func (*Friday) History

func (f *Friday) History(history []map[string]string) *Friday

func (*Friday) Ingest

func (f *Friday) Ingest(res *IngestState) *Friday

func (*Friday) Keywords

func (f *Friday) Keywords(res *KeywordsState) *Friday

func (*Friday) Namespace

func (f *Friday) Namespace(namespace *models.Namespace) *Friday

func (*Friday) OfSummary

func (f *Friday) OfSummary(summary string) *Friday

func (*Friday) OfType

func (f *Friday) OfType(summaryType summary.SummaryType) *Friday

func (*Friday) OriginFile

func (f *Friday) OriginFile(ps *string) *Friday

func (*Friday) Question

func (f *Friday) Question(q string) *Friday

func (*Friday) SearchIn

func (f *Friday) SearchIn(query *models.DocQuery) *Friday

func (*Friday) Summary

func (f *Friday) Summary(res *SummaryState) *Friday

func (*Friday) WithContext

func (f *Friday) WithContext(ctx context.Context) *Friday

type IngestState

type IngestState struct {
	Tokens map[string]int
}

type KeywordsState

type KeywordsState struct {
	Keywords []string
	Tokens   map[string]int
}

type Statement

type Statement struct {

	// for chat
	Summary        string // Summary of doc
	HistorySummary string // Summary of chat history
	Info           string // Info of embedding
	// contains filtered or unexported fields
}

type SummaryState

type SummaryState struct {
	Summary map[string]string
	Tokens  map[string]int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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