documents

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidUTF8File

func IsValidUTF8File(filePath string) (bool, error)

Based on a sample of the file, checks if the file contains valid UTF-8 encoding.

Types

type Document

type Document struct {
	// Relative path within the project directory.
	Path    string
	Content string
}

A Document represents a text file from the project directory, such as `README.md`, to be included in the context sent to the LLM.

func LoadDocuments

func LoadDocuments(projectPath string, excludePatterns []string, maxFileSize int64) ([]Document, error)

Given the project path, loads documents that will be included in the context sent to the LLM.

It accepts additional .gitignore glob patterns for files to be excluded and respects any .gitignore files in the project directory.

It excludes files whose size exceeds the maxFileSize argument.

Jump to

Keyboard shortcuts

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