Documentation
¶
Index ¶
- Constants
- Variables
- func FormatPageIndexHitsExpert(hits []PageIndexHit) string
- func GenerateIndexDocDescription(ctx context.Context, llm LLMProvider, tree *IndexTree) (string, error)
- func IndexTreeJSONForLLM(tree *IndexTree) ([]byte, error)
- func SelectDocIDsByDescriptions(ctx context.Context, llm LLMProvider, query string, docs []DocSearchCandidate) ([]string, string, error)
- type ChunkBuilder
- type DocSearchCandidate
- type IndexBuilder
- type IndexConfig
- type IndexNode
- type IndexSearchResult
- type IndexStore
- type IndexTree
- type LLMProvider
- type MarkdownParser
- type MemoryItem
- type Message
- type PageIndexHit
- type PageIndexKind
- type PageIndexRAG
- type PageIndexRAGResult
- type PageIndexSearchOptions
- type PageIndexStore
- type SearchOptions
- type SearchResult
- type Tool
- type TreeSearchResult
Constants ¶
View Source
const ( PageKindPreference = typescore.PageKindPreference PageKindKnowledge = typescore.PageKindKnowledge PageKindLongTerm = typescore.PageKindLongTerm PageKindKnowledgeBase = typescore.PageKindKnowledgeBase )
Variables ¶
View Source
var EstimateTokens = utils.EstimateTokens
Functions ¶
func FormatPageIndexHitsExpert ¶
func FormatPageIndexHitsExpert(hits []PageIndexHit) string
func IndexTreeJSONForLLM ¶
func SelectDocIDsByDescriptions ¶
func SelectDocIDsByDescriptions(ctx context.Context, llm LLMProvider, query string, docs []DocSearchCandidate) ([]string, string, error)
Types ¶
type ChunkBuilder ¶
type ChunkBuilder struct {
// contains filtered or unexported fields
}
func NewChunkBuilder ¶
func NewChunkBuilder(maxTokens, overlapTokens int) *ChunkBuilder
func (*ChunkBuilder) ChunkByTokens ¶
func (b *ChunkBuilder) ChunkByTokens(text string, tokenCount func(string) int) []string
type DocSearchCandidate ¶
type DocSearchCandidate = typescore.DocSearchCandidate
type IndexBuilder ¶
type IndexBuilder struct {
// contains filtered or unexported fields
}
func NewIndexBuilder ¶
func NewIndexBuilder(llm LLMProvider, cfg *IndexConfig) *IndexBuilder
func NewIndexBuilderWithStore ¶
func NewIndexBuilderWithStore(llm LLMProvider, cfg *IndexConfig, store IndexStore) *IndexBuilder
func (*IndexBuilder) BuildFromMarkdown ¶
type IndexConfig ¶
type IndexConfig = typescore.IndexConfig
type IndexSearchResult ¶
type IndexSearchResult = typescore.IndexSearchResult
type IndexStore ¶
type IndexStore = typescore.IndexStore
type LLMProvider ¶
type LLMProvider = typescore.LLMProvider
type MarkdownParser ¶
type MarkdownParser = stores.MarkdownParser
type MemoryItem ¶
type MemoryItem = typescore.MemoryItem
type PageIndexHit ¶
type PageIndexHit = typescore.PageIndexHit
type PageIndexKind ¶
type PageIndexKind = typescore.PageIndexKind
type PageIndexRAG ¶
type PageIndexRAG struct {
Store PageIndexStore
LLM LLMProvider
Limit int
}
func NewPageIndexRAG ¶
func NewPageIndexRAG(store PageIndexStore, llm LLMProvider) *PageIndexRAG
func (*PageIndexRAG) Retrieve ¶
func (r *PageIndexRAG) Retrieve(ctx context.Context, userID, query string, kinds []PageIndexKind) (*PageIndexRAGResult, error)
type PageIndexRAGResult ¶
type PageIndexRAGResult = typescore.PageIndexRAGResult
type PageIndexSearchOptions ¶
type PageIndexSearchOptions = typescore.PageIndexSearchOptions
type PageIndexStore ¶
type PageIndexStore = typescore.PageIndexStore
type SearchOptions ¶
type SearchOptions = typescore.SearchOptions
type SearchResult ¶
type SearchResult = typescore.SearchResult
type TreeSearchResult ¶
type TreeSearchResult = typescore.TreeSearchResult
func TreeSearchIndexTree ¶
func TreeSearchIndexTree(ctx context.Context, llm LLMProvider, tree *IndexTree, query, expertContext string) (*TreeSearchResult, error)
Click to show internal directories.
Click to hide internal directories.