@@ -57,17 +57,13 @@ export const interpreter = (params: InterpreterToolParams) => {
5757 "Execute python code in a Jupyter notebook cell and return any result, stdout, stderr, display_data, and error." ,
5858 parameters : z . object ( {
5959 code : z . string ( ) . describe ( "The python code to execute in a single cell" ) ,
60- sandboxFiles : z
61- . array ( z . string ( ) )
62- . optional ( )
63- . describe ( "List of local file paths to be used by the code" ) ,
6460 retryCount : z
6561 . number ( )
6662 . default ( 0 )
6763 . optional ( )
6864 . describe ( "The number of times the tool has been retried" ) ,
6965 } ) ,
70- execute : async ( { code, sandboxFiles , retryCount = 0 } ) => {
66+ execute : async ( { code, retryCount = 0 } ) => {
7167 if ( retryCount >= 3 ) {
7268 return {
7369 isError : true ,
@@ -78,7 +74,7 @@ export const interpreter = (params: InterpreterToolParams) => {
7874 }
7975
8076 const interpreter = await Sandbox . create ( { apiKey } ) ;
81- await uploadFilesToSandbox ( interpreter , uploadedFilesDir , sandboxFiles ) ;
77+ await uploadFilesToSandbox ( interpreter , uploadedFilesDir ) ;
8278 const exec = await interpreter . runCode ( code ) ;
8379 const extraResult = await getExtraResult (
8480 outputDir ,
@@ -100,9 +96,9 @@ export const interpreter = (params: InterpreterToolParams) => {
10096async function uploadFilesToSandbox (
10197 codeInterpreter : Sandbox ,
10298 uploadedFilesDir : string ,
103- sandboxFiles : string [ ] = [ ] ,
10499) {
105100 try {
101+ const sandboxFiles = fs . readdirSync ( uploadedFilesDir ) ;
106102 for ( const filePath of sandboxFiles ) {
107103 const fileName = path . basename ( filePath ) ;
108104 const localFilePath = path . join ( uploadedFilesDir , fileName ) ;
0 commit comments