-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set working directory of tool calls to the directory of the file
- Loading branch information
1 parent
701b9c8
commit 6126d27
Showing
23 changed files
with
518 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package runner | ||
|
||
import "github.com/gptscript-ai/gptscript/pkg/mvl" | ||
|
||
var log = mvl.Package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/gptscript-ai/gptscript/pkg/tests/tester" | ||
"github.com/gptscript-ai/gptscript/pkg/types" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestCwd(t *testing.T) { | ||
runner := tester.NewRunner(t) | ||
|
||
runner.RespondWith(tester.Result{ | ||
Func: types.CompletionFunctionCall{ | ||
Name: "subtool/test", | ||
}, | ||
}) | ||
runner.RespondWith(tester.Result{ | ||
Func: types.CompletionFunctionCall{ | ||
Name: "local", | ||
}, | ||
}) | ||
x := runner.RunDefault() | ||
assert.Equal(t, "TEST RESULT CALL: 3", x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
`{ | ||
"Model": "gpt-4-turbo-preview", | ||
"InternalSystemPrompt": null, | ||
"Tools": [ | ||
{ | ||
"function": { | ||
"name": "test", | ||
"parameters": null | ||
} | ||
}, | ||
{ | ||
"function": { | ||
"name": "local", | ||
"parameters": null | ||
} | ||
} | ||
], | ||
"Messages": [ | ||
{ | ||
"role": "system", | ||
"content": [ | ||
{ | ||
"text": "noop" | ||
} | ||
] | ||
}, | ||
{ | ||
"role": "assistant", | ||
"content": [ | ||
{ | ||
"toolCall": { | ||
"index": 0, | ||
"id": "call_1", | ||
"function": { | ||
"name": "test" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"role": "tool", | ||
"content": [ | ||
{ | ||
"text": "sub\nsub" | ||
} | ||
], | ||
"toolCall": { | ||
"index": 0, | ||
"id": "call_1", | ||
"function": { | ||
"name": "test" | ||
} | ||
} | ||
}, | ||
{ | ||
"role": "assistant", | ||
"content": [ | ||
{ | ||
"toolCall": { | ||
"index": 1, | ||
"id": "call_2", | ||
"function": { | ||
"name": "local" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"role": "tool", | ||
"content": [ | ||
{ | ||
"text": "/testdata/TestCwd\nthe data" | ||
} | ||
], | ||
"toolCall": { | ||
"index": 1, | ||
"id": "call_2", | ||
"function": { | ||
"name": "local" | ||
} | ||
} | ||
} | ||
], | ||
"MaxTokens": 0, | ||
"Temperature": null, | ||
"JSONResponse": false, | ||
"Grammar": "", | ||
"Cache": null | ||
}` |
Oops, something went wrong.