Skip to content
Discussion options

You must be logged in to vote

I've been working on the same problem.
And yet, the LLM does not know the lines number. Mostly cause the whole thing is a big ball of text, with text before and after (prompts). You can't rely on the line numbers.
What you must do:
Write a tool that takes 3 parameters:

  • file_path
  • old_string
  • new_string

And in the description of the old_string, specify that the old_string must be unique in the text, and to do that, It should take a couple of lines before and couple of lines after what it actually wants to change, to compose the old_string. That way, in your tool, you can simply gsub the original text with the old_string and the new_string. No line numbers. Just text matching.

Does this mak…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by crmne
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #182 on May 18, 2025 13:23.