diff --git a/delete-file.gpt b/delete-file.gpt index 97962d1..53888e4 100644 --- a/delete-file.gpt +++ b/delete-file.gpt @@ -1,4 +1,6 @@ Name: Knowledge File Deletion Description: Delete a file. +Params: File: The file to delete +Params: Dataset: The dataset to delete the file from -#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool delete-file "${GPTSCRIPT_INPUT}" +#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool delete-file --dataset "${DATASET}" "ws://${FILE}" diff --git a/pkg/cmd/delete_file.go b/pkg/cmd/delete_file.go index 1e5129d..58ae57c 100644 --- a/pkg/cmd/delete_file.go +++ b/pkg/cmd/delete_file.go @@ -37,7 +37,7 @@ func (s *ClientDeleteFile) Run(cmd *cobra.Command, args []string) error { Dataset: s.Dataset, } - if strings.HasPrefix(fileRef, "/") { + if strings.HasPrefix(fileRef, "/") || strings.HasPrefix(fileRef, "ws://") { searchFile.AbsolutePath = fileRef } else if _, err := uuid.Parse(fileRef); err == nil { searchFile.ID = fileRef