augmenter

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(embedder string, options *option.Options) string

func NewPDFSplitter

func NewPDFSplitter(maxChunk int) fsplitter.Splitter

NewPDFSplitter returns a Splitter that extracts printable text and delegates to a size-based splitter for chunking.

func ResolveIndexPath

func ResolveIndexPath(ctx context.Context, template string) string

ResolveIndexPath resolves an index path template using env overrides and defaults.

func WithIndexAsync

func WithIndexAsync(enabled bool) func(*Service)

WithIndexAsync toggles background indexing.

func WithIndexPathTemplate

func WithIndexPathTemplate(template string) func(*Service)

WithIndexPathTemplate sets the base path template for Embedius indexes.

func WithIndexPathTemplateContext

func WithIndexPathTemplateContext(ctx context.Context, template string) context.Context

WithIndexPathTemplateContext stores an index path template in context.

func WithLocalRoots

func WithLocalRoots(ctx context.Context, roots []LocalRoot) context.Context

WithLocalRoots attaches per-request local roots for upstream resolution.

func WithLocalUpstreams

func WithLocalUpstreams(roots []LocalRoot, upstreams []LocalUpstream) func(*Service)

WithLocalUpstreams configures local resource upstreams and root bindings.

func WithMCPManager

func WithMCPManager(m *mcpmgr.Manager) func(*Service)

WithMCPManager attaches an MCP manager so the augmenter can index mcp: resources.

func WithMCPSnapshotCacheRoot

func WithMCPSnapshotCacheRoot(template string) func(*Service)

WithMCPSnapshotCacheRoot sets the MCP snapshot cache root template.

func WithMCPSnapshotManifestResolver

func WithMCPSnapshotManifestResolver(resolver mcpfs.SnapshotManifestResolver) func(*Service)

WithMCPSnapshotManifestResolver enables snapshot MD5 manifests when configured.

func WithMCPSnapshotResolver

func WithMCPSnapshotResolver(resolver mcpfs.SnapshotResolver) func(*Service)

WithMCPSnapshotResolver enables snapshot-based MCP reads when available.

func WithMatchConcurrency

func WithMatchConcurrency(n int) func(*Service)

WithMatchConcurrency sets the max number of concurrent match operations.

func WithUpstreamSyncConcurrency

func WithUpstreamSyncConcurrency(n int) func(*Service)

WithUpstreamSyncConcurrency sets the max number of concurrent upstream syncs.

Types

type AugmentDocsInput

type AugmentDocsInput struct {
	Query           string
	Locations       []string
	Match           *option.Options
	Model           string
	DB              string
	MaxResponseSize int //size in byte
	MaxDocuments    int
	Offset          int
	//based on meta['path'] include full path as long it does not go over //max response size
	IncludeFile bool
	TrimPath    string //trim path prefix
	// AllowPartial returns matches from successful roots even if others fail.
	AllowPartial bool
}

func (*AugmentDocsInput) Init

func (i *AugmentDocsInput) Init(ctx context.Context)

func (*AugmentDocsInput) Location

func (i *AugmentDocsInput) Location(location string) string

func (*AugmentDocsInput) Validate

func (i *AugmentDocsInput) Validate(ctx context.Context) error

type AugmentDocsOutput

type AugmentDocsOutput struct {
	Content       string
	Documents     []embSchema.Document
	DocumentsSize int
}

AugmentDocsOutput represents output from extraction

func (*AugmentDocsOutput) LoadDocuments

func (o *AugmentDocsOutput) LoadDocuments(ctx context.Context, fs afs.Service) []embSchema.Document

type DocsAugmenter

type DocsAugmenter struct {
	// contains filtered or unexported fields
}

func NewDocsAugmenter

func NewDocsAugmenter(ctx context.Context, embeddingsModel string, embedder baseembed.Embedder, options ...option.Option) (*DocsAugmenter, error)

func NewDocsAugmenterWithStore

func NewDocsAugmenterWithStore(ctx context.Context, embeddingsModel string, embedder baseembed.Embedder, store *sqlitevec.Store, options ...option.Option) *DocsAugmenter

NewDocsAugmenterWithStore constructs a DocsAugmenter that reuses the provided sqlitevec store.

type Document

type Document embSchema.Document

func (Document) ProjectDocument

func (d Document) ProjectDocument() *graph.Document

func (Document) Size

func (d Document) Size() int

type Documents

type Documents []embSchema.Document

func (Documents) ProjectDocuments

func (d Documents) ProjectDocuments() graph.Documents

func (Documents) Size

func (d Documents) Size() int

type LocalRoot

type LocalRoot struct {
	ID          string
	URI         string
	UpstreamRef string
	SyncEnabled *bool
	MinInterval int
	Batch       int
	Shadow      string
	Force       *bool
}

LocalRoot binds a non-MCP resource root to an upstream definition.

type LocalUpstream

type LocalUpstream struct {
	Name               string
	Driver             string
	DSN                string
	Shadow             string
	Batch              int
	Force              bool
	Enabled            *bool
	MinIntervalSeconds int
}

LocalUpstream defines a database used to sync local/workspace resources.

type Service

type Service struct {
	DocsAugmenters shared.Map[string, *DocsAugmenter]
	// contains filtered or unexported fields
}

Service extracts structured information from LLM responses

func New

func New(finder embedder.Finder, opts ...func(*Service)) *Service

New creates a new extractor service

func (*Service) AugmentDocs

func (s *Service) AugmentDocs(ctx context.Context, input *AugmentDocsInput, output *AugmentDocsOutput) error

func (*Service) Method

func (s *Service) Method(name string) (svc.Executable, error)

Method returns the specified method

func (*Service) Methods

func (s *Service) Methods() svc.Signatures

Methods returns the service methods

func (*Service) Name

func (s *Service) Name() string

Name returns the service name

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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