File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,15 @@ jobs:
47
47
- name : Install gptscript
48
48
run : |
49
49
curl https://get.gptscript.ai/releases/default_windows_amd64_v1/gptscript.exe -o gptscript.exe
50
+ - name : Create config file
51
+ run : |
52
+ echo '{"credsStore":"file"}' > config
50
53
- name : Install dependencies
51
54
run : npm install
52
55
- name : Run Tests
53
56
env :
54
57
GPTSCRIPT_BIN : .\gptscript.exe
58
+ GPTSCRIPT_CONFIG_FILE : .\config
55
59
OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
56
60
NODE_GPTSCRIPT_SKIP_INSTALL_BINARY : true
57
61
run : npm test
Original file line number Diff line number Diff line change @@ -401,21 +401,24 @@ describe("gptscript module", () => {
401
401
} , 10000 )
402
402
403
403
test ( "confirm" , async ( ) => {
404
- let confirmFound = false
405
404
const t = {
406
405
instructions : "List the files in the current working directory." ,
407
406
tools : [ "sys.exec" ]
408
407
}
408
+
409
+ const commands = [ `"ls"` , `"dir"` ]
410
+ let confirmCallCount = 0
409
411
const run = await g . evaluate ( t , { confirm : true } )
410
412
run . on ( gptscript . RunEventType . CallConfirm , async ( data : gptscript . CallFrame ) => {
411
- expect ( data . input ) . toContain ( `"ls"` )
412
- confirmFound = true
413
+ // On Windows, ls is not always a command. The LLM will try to run dir in this case. Allow both.
414
+ expect ( data . input ) . toContain ( commands [ confirmCallCount ] )
415
+ confirmCallCount ++
413
416
await g . confirm ( { id : data . id , accept : true } )
414
417
} )
415
418
416
419
expect ( await run . text ( ) ) . toContain ( "README.md" )
417
420
expect ( run . err ) . toEqual ( "" )
418
- expect ( confirmFound ) . toBeTruthy ( )
421
+ expect ( confirmCallCount > 0 ) . toBeTruthy ( )
419
422
} )
420
423
421
424
test ( "do not confirm" , async ( ) => {
You can’t perform that action at this time.
0 commit comments