| 396 | }; |
| 397 | |
| 398 | const addTextFileDetails = (filepath: string, currentData: { [key: string]: string; contents: string }) => { |
| 399 | try { |
| 400 | if (fs.lstatSync(filepath).size > 10000000) return; |
| 401 | const rawText = fs.readFileSync(filepath, "utf8"); |
| 402 | const text = rawText; |
| 403 | const instruction = `\n<Text of the file: ###${text}###>`; |
| 404 | currentData.contents += instruction; |
| 405 | } catch (err) { |
| 406 | console.error(err); |
| 407 | } |
| 408 | }; |
| 409 | |
| 410 | const attemptAddRawText = (filepath: string, currentData: { [key: string]: string; contents: string }) => { |
| 411 | try { |