Skip to content

Commit

Permalink
bug: always prefer tool's given name over the referenced name
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud authored and cjellick committed Sep 6, 2024
1 parent d97d564 commit 8128bbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/tests/testdata/TestCase2/call1.golden
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"function": {
"toolID": "testdata/TestCase2/test.gpt:bob",
"name": "Bob",
"name": "bob",
"description": "I'm Bob, a friendly guy.",
"parameters": {
"properties": {
Expand Down
5 changes: 4 additions & 1 deletion pkg/types/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,10 @@ func toolRefsToCompletionTools(completionTools []ToolReference, prg Program) (re
for _, subToolRef := range completionTools {
subTool := prg.ToolSet[subToolRef.ToolID]

subToolName := subToolRef.Reference
subToolName := subTool.Name
if subToolName == "" {
subToolName = subToolRef.Reference
}
if subToolRef.Named != "" {
subToolName = subToolRef.Named
}
Expand Down

0 comments on commit 8128bbc

Please sign in to comment.