core

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	ID        string            // Unique identifier for the chunk
	Content   string            // Text content of the chunk
	Metadata  map[string]string // Metadata about the chunk (source, position, etc.)
	MediaType string            // Media type (e.g., "text/plain", "image/jpeg")
	MediaData []byte            // Binary data for non-text content (e.g., images)
}

Chunk represents a parsed document chunk

A Chunk is a piece of a document that has been parsed and prepared for embedding and storage in the vector store.

Example:

chunk := Chunk{
    ID:       "chunk-1",
    Content:  "Go is an open source programming language...",
    Metadata: map[string]string{
        "source": "example.txt",
        "page":   "1",
    },
    MediaType: "text/plain",
}

type Result

type Result struct {
	Chunk
	Score float32
}

Result represents a search result with relevance score

type SearchOptions

type SearchOptions struct {
	TopK     int
	Filter   map[string]interface{}
	MinScore float32
}

SearchOptions configures search behavior

type Source

type Source struct {
	Type    string
	Path    string
	Content string
	Reader  interface{}
}

Source represents a document source

Jump to

Keyboard shortcuts

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