gptscript icon indicating copy to clipboard operation
gptscript copied to clipboard

Provide better output when `sys.find` does not return any files.

Open sangee2004 opened this issue 11 months ago • 1 comments

Steps to reproduce the problem:

  1. git clone https://github.com/gptscript-ai/gptscript
  2. Create a new gptscript using sys.find tool will not return any files
 % cat examples/testfind.gpt 
tools: sys.find

Find all sample *.exe file in examples/
  1. Execute this script .
  2. Notice that there is no output in this case
 % gptscript examples/testfind.gpt
17:18:34 started  [main]
17:18:34 sent     [main]
         content  [1] content | Waiting for model response...
         content  [1] content | tool call sys -> {"directory":"examples/","pattern":"*.exe"}
17:18:35 started  [sys.find(2)] [input={"directory":"examples/","pattern":"*.exe"}]
17:18:35 sent     [sys.find(2)]
17:18:35 ended    [sys.find(2)]
17:18:35 continue [main]
17:18:35 sent     [main]
         content  [1] content | Waiting for model response...
17:18:36 continue [main]
2024/02/28 17:18:36 invalid continue call, no completion needed

Tool not providing any output in this case , results in the gptscript using this tool along with other tools.

This behavior can be seen with some non existent files being used when executing samples-readme.gpt script from /examples directory.

17:23:20 started  [main]
17:23:20 sent     [main]
17:23:20 started  [sys.find(2)] [input={"directory":"examples/","pattern":"*.gpt"}]
17:23:20 sent     [sys.find(2)]
17:23:20 ended    [sys.find(2)]
17:23:20 continue [main]
17:23:20 sent     [main]
17:23:20 started  [summary(3)] [input={"file": "examples/sample1.gpt"}]
17:23:20 started  [summary(4)] [input={"file": "examples/sample3.gpt"}]
17:23:20 started  [summary(5)] [input={"file": "examples/sample2.gpt"}]
17:23:20 sent     [summary(3)]
17:23:20 sent     [summary(4)]
17:23:20 sent     [summary(5)]
         content  [4] content | Waiting for model response...
17:23:20 started  [summary(6)->sys.read(6)] [input={"filename":"examples/sample1.gpt"}]
17:23:20 sent     [summary(6)->sys.read(6)]
2024/02/28 17:23:20 open examples/sample1.gpt: no such file or directory

sangee2004 avatar Feb 29 '24 19:02 sangee2004

This issue is addressed in the latest version.

We get "No *.exe files were found in the examples/ directory." error as output when sys.tool finds no matching file to return.

sangee2004 avatar Mar 08 '24 18:03 sangee2004

can thi se closed then?

cjellick avatar Jul 08 '24 20:07 cjellick

Closing this issue since we get an output stating that no files are found.

sangee2004 avatar Jul 08 '24 20:07 sangee2004