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

Commit 17ea088

Browse files
committed
fix: delete-file adapt to ws://
1 parent 7b089d1 commit 17ea088

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

delete-file.gpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Name: Knowledge File Deletion
22
Description: Delete a file.
3+
Params: File: The file to delete
4+
Params: Dataset: The dataset to delete the file from
35

4-
#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool delete-file "${GPTSCRIPT_INPUT}"
6+
#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool delete-file --dataset "${DATASET}" "ws://${FILE}"

pkg/cmd/delete_file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (s *ClientDeleteFile) Run(cmd *cobra.Command, args []string) error {
3737
Dataset: s.Dataset,
3838
}
3939

40-
if strings.HasPrefix(fileRef, "/") {
40+
if strings.HasPrefix(fileRef, "/") || strings.HasPrefix(fileRef, "ws://") {
4141
searchFile.AbsolutePath = fileRef
4242
} else if _, err := uuid.Parse(fileRef); err == nil {
4343
searchFile.ID = fileRef

0 commit comments

Comments
 (0)