File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ func ToolNormalizer(tool string) string {
23
23
24
24
parts := strings .Split (lastTool , "/" )
25
25
tool = parts [len (parts )- 1 ]
26
+ if parts [len (parts )- 1 ] == "tool.gpt" && len (parts ) > 1 && len (parts [len (parts )- 2 ]) > 1 {
27
+ tool = parts [len (parts )- 2 ]
28
+ }
26
29
if strings .HasSuffix (tool , system .Suffix ) {
27
30
tool = strings .TrimSuffix (tool , filepath .Ext (tool ))
28
31
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ func TestToolNormalizer(t *testing.T) {
14
14
autogold .Expect ("barList" ).Equal (t , ToolNormalizer ("bar_list from ./foo.gpt" ))
15
15
autogold .Expect ("write" ).Equal (t , ToolNormalizer ("sys.write" ))
16
16
autogold .Expect ("gpt4VVision" ).Equal (t , ToolNormalizer ("github.com/gptscript-ai/gpt4-v-vision" ))
17
+ autogold .Expect ("foo" ).Equal (t , ToolNormalizer ("./foo/tool.gpt" ))
17
18
}
18
19
19
20
func TestParse (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments