prompt

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstimateTokens

func EstimateTokens(output string) int64

func GenerateIgnoreList

func GenerateIgnoreList(repoPath, ignoreFilePath string, useGitignore bool) []string

func GenerateIncludeList added in v0.6.1

func GenerateIncludeList(repoPath, includeFilePath string) []string

Generate include list from .gptinclude file

func MarshalRepo

func MarshalRepo(repo *GitRepo, scrubComments bool) ([]byte, error)

func OutputGitRepo

func OutputGitRepo(repo *GitRepo, preambleFile string, scrubComments bool) (string, error)

func OutputGitRepoXML added in v0.6.0

func OutputGitRepoXML(repo *GitRepo, scrubComments bool) (string, error)

func ValidateXML added in v0.6.0

func ValidateXML(xmlString string) error

Types

type GitFile

type GitFile struct {
	Path     string `json:"path" xml:"path"`         // path to the file relative to the repository root
	Tokens   int64  `json:"tokens" xml:"tokens"`     // number of tokens in the file
	Contents string `json:"contents" xml:"contents"` // contents of the file
}

type GitRepo

type GitRepo struct {
	TotalTokens int64     `json:"total_tokens" xml:"total_tokens"`
	Files       []GitFile `json:"files" xml:"files>file"`
	FileCount   int       `json:"file_count" xml:"file_count"`
}

func ProcessGitRepo

func ProcessGitRepo(repoPath string, includeList, ignoreList []string) (*GitRepo, error)

Update the function signature to accept includeList

Jump to

Keyboard shortcuts

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