Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #149 from StrongMonkey/add-delete-file
Browse files Browse the repository at this point in the history
Add delete file options, don't run prune
  • Loading branch information
StrongMonkey authored Oct 21, 2024
2 parents 2d5d727 + 12ec126 commit fbc53d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions delete-file.gpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Name: Knowledge File Deletion
Description: Delete a file.

#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool delete-file "${GPTSCRIPT_INPUT}"
2 changes: 1 addition & 1 deletion ingest.gpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Name: Knowledge Ingestion
Description: Ingest content into a dataset.
Credential: github.com/gptscript-ai/credentials/model-provider

#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool ingest --prune --dataset ${GPTSCRIPT_DATASET} "${GPTSCRIPT_INPUT}"
#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool ingest --dataset ${GPTSCRIPT_DATASET} "${GPTSCRIPT_INPUT}"
7 changes: 6 additions & 1 deletion pkg/client/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ func ingestPaths(ctx context.Context, c Client, opts *IngestPathsOpts, datasetID
metadataStack = append(metadataStack, *newMetadata)
return nil
}
if isIgnored(ignore, subPath) {

rel, err := filepath.Rel(path, subPath)
if err != nil {
return fmt.Errorf("failed to get rel path, error: %w", err)
}
if isIgnored(ignore, rel) {
slog.Debug("Ignoring file", "path", subPath, "ignorefile", opts.IgnoreFile, "ignoreExtensions", opts.IgnoreExtensions)
return nil
}
Expand Down

0 comments on commit fbc53d0

Please sign in to comment.