Skip to content

Commit c8489ec

Browse files
committed
fix: fixed bug in how examples were generated for patch tool
1 parent 2e08a3a commit c8489ec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gptme/tools/patch.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@
2828
mode: Literal["markdown", "xml"] = "markdown"
2929

3030

31-
def patch_to_markdown(patch: str, filename: str, append: bool = False) -> str:
31+
def patch_to_markdown(filename: str, patch: str, append: bool = False) -> str:
3232
_tool = "patch" if not append else "append"
3333
return f"```{_tool} {filename}\n{patch}\n```"
3434

3535

36-
def patch_to_xml(patch: str, filename: str, append: bool = False) -> str:
36+
def patch_to_xml(filename: str, patch: str, append: bool = False) -> str:
3737
_tool = "patch" if not append else "append"
3838
return f"<{_tool} filename='{filename}'>\n{patch}\n</patch>"
3939

4040

41-
def patch_to_output(patch: str, filename: str, append: bool = False) -> str:
41+
def patch_to_output(filename: str, patch: str, append: bool = False) -> str:
4242
if mode == "markdown":
43-
return patch_to_markdown(patch, filename, append)
43+
return patch_to_markdown(filename, patch, append)
4444
elif mode == "xml":
45-
return patch_to_xml(patch, filename, append)
45+
return patch_to_xml(filename, patch, append)
4646
else:
4747
raise ValueError(f"Invalid mode: {mode}")
4848

0 commit comments

Comments
 (0)