Skip to content

Commit 02e3dce

Browse files
author
Eric Wheeler
committed
docs: add example for handling large files with insert_content
Add documentation showing how to use insert_content in conjunction with write_to_file to handle files that exceed output limits by breaking them into multiple append operations. Signed-off-by: Eric Wheeler <[email protected]>
1 parent d9827b9 commit 02e3dce

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/core/prompts/tools/insert-content.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,23 @@ Example for appending to the end of file:
2929
// This is the end of the file
3030
</content>
3131
</insert_content>
32+
33+
Example for creating very large files that exceed output limits:
34+
<write_to_file>
35+
<path>src/large_file.txt</path>
36+
<content>
37+
// This is the beginning of a very large file but you must terminate prematurely in order for line_count to be produced:
38+
</content>
39+
<line_count>100</line_count>
40+
</write_to_file>
41+
42+
Then use insert_content to append the rest of the content starting immediately where you left off; repeat as many times as necessary:
43+
<insert_content>
44+
<path>src/large_file.txt</path>
45+
<line>0</line>
46+
<content>
47+
// This is a continuation of very large file
48+
</content>
49+
</insert_content>
3250
`
3351
}

0 commit comments

Comments
 (0)