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

Commit

Permalink
fix: delete-file adapt to ws://
Browse files Browse the repository at this point in the history
  • Loading branch information
iwilltry42 committed Oct 29, 2024
1 parent 7b089d1 commit 17ea088
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion delete-file.gpt
Original file line number Diff line number Diff line change
@@ -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}"
2 changes: 1 addition & 1 deletion pkg/cmd/delete_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 17ea088

Please sign in to comment.