Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/git_bob/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
__version__ = "0.23.1"

__version__ = "0.24.0"

__all__ = (
)
17 changes: 16 additions & 1 deletion src/git_bob/_ai_github_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,16 @@
## Your task
Modify content of the file "{filename}" to solve the issue above.
Keep your modifications absolutely minimal.
Return the entire new file content, do not shorten it.
If the modifications are long, return the entire new file content, do not shorten it.
If the modification is short, return the original part you would like to replace and the new part you would like to replace it with.
Do this in this format:

<original_part>
Original (unmodified) part of the file content you would like to replace.
</original_part>
<new_part>
New (modified) part of the file content you would like to replace it with.
</new_part>
"""
else:
print(filename, "will be created")
Expand Down Expand Up @@ -430,6 +439,12 @@

new_content, commit_message = split_content_and_summary(response)

if "<original_part>" in new_content and "<new_part>" in new_content:
for part in new_content.split("</new_part>")[:-1]:
original_part = part.split("<original_part>")[1].split("</original_part>")[0]
new_part = part.split("<new_part>")[1]
new_content = file_content.replace(original_part, new_part)

Check warning on line 446 in src/git_bob/_ai_github_utilities.py

View check run for this annotation

Codecov / codecov/patch

src/git_bob/_ai_github_utilities.py#L443-L446

Added lines #L443 - L446 were not covered by tests

print("New file content", len(new_content), "\n------------\n", new_content[:200], "\n------------")

do_execute_notebook = False
Expand Down