diff --git a/delete-file.gpt b/delete-file.gpt new file mode 100644 index 0000000..97962d1 --- /dev/null +++ b/delete-file.gpt @@ -0,0 +1,4 @@ +Name: Knowledge File Deletion +Description: Delete a file. + +#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool delete-file "${GPTSCRIPT_INPUT}" diff --git a/ingest.gpt b/ingest.gpt index 20a4f17..715a153 100644 --- a/ingest.gpt +++ b/ingest.gpt @@ -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}" diff --git a/pkg/client/common.go b/pkg/client/common.go index 91612c7..58bdc81 100644 --- a/pkg/client/common.go +++ b/pkg/client/common.go @@ -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 }