File tree Expand file tree Collapse file tree 1 file changed +28
-25
lines changed Expand file tree Collapse file tree 1 file changed +28
-25
lines changed Original file line number Diff line number Diff line change @@ -31,41 +31,44 @@ export const kith: EvalFunction = async ({
31
31
32
32
const success = evaluation === "YES" ;
33
33
34
- await agent . execute ( {
35
- instruction : "fill the payment information" ,
36
- maxSteps : 30 ,
37
- } ) ;
38
-
39
- const { evaluation : evaluation2 , reasoning : reasoning2 } =
40
- await evaluator . evaluate ( {
41
- question : "Did the agent fill the payment information" ,
34
+ if ( success ) {
35
+ await agent . execute ( {
36
+ instruction : "fill the payment information" ,
37
+ maxSteps : 30 ,
42
38
} ) ;
43
39
44
- const success2 = evaluation2 === "YES" ;
40
+ const { evaluation : evaluation2 , reasoning : reasoning2 } =
41
+ await evaluator . evaluate ( {
42
+ question : "Did the agent fill the payment information" ,
43
+ } ) ;
45
44
46
- if ( ! success ) {
47
- return {
48
- _success : false ,
49
- message : `${ reasoning } ${ reasoning2 } ` ,
50
- debugUrl,
51
- sessionUrl,
52
- logs : logger . getLogs ( ) ,
53
- } ;
54
- } else if ( ! success2 ) {
45
+ const success2 = evaluation2 === "YES" ;
46
+
47
+ if ( success2 ) {
48
+ return {
49
+ _success : true ,
50
+ debugUrl,
51
+ sessionUrl,
52
+ logs : logger . getLogs ( ) ,
53
+ } ;
54
+ } else {
55
+ return {
56
+ _success : false ,
57
+ message : reasoning2 ,
58
+ debugUrl,
59
+ sessionUrl,
60
+ logs : logger . getLogs ( ) ,
61
+ } ;
62
+ }
63
+ } else {
55
64
return {
56
65
_success : false ,
57
- message : reasoning2 ,
66
+ message : reasoning ,
58
67
debugUrl,
59
68
sessionUrl,
60
69
logs : logger . getLogs ( ) ,
61
70
} ;
62
71
}
63
- return {
64
- _success : true ,
65
- debugUrl,
66
- sessionUrl,
67
- logs : logger . getLogs ( ) ,
68
- } ;
69
72
} catch ( error ) {
70
73
return {
71
74
_success : false ,
You can’t perform that action at this time.
0 commit comments