gptdiff 0.1.16__py3-none-any.whl → 0.1.18__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
gptdiff/gptdiff.py CHANGED
@@ -697,14 +697,14 @@ def call_llm_for_apply(file_path, original_content, file_diff, model, api_key=No
697
697
  4. You must return the entire file. It overwrites the existing file."""
698
698
  user_prompt = f"""File: {file_path}
699
699
  File contents:
700
- <filecontents>
700
+ ```
701
701
  {original_content}
702
- </filecontents>
702
+ ```
703
703
 
704
704
  Diff to apply:
705
- <diff>
705
+ ```diff
706
706
  {file_diff}
707
- </diff>"""
707
+ ```"""
708
708
  if extra_prompt:
709
709
  user_prompt += f"\n\n{extra_prompt}"
710
710
  if model == "gemini-2.0-flash-thinking-exp-01-21":
@@ -867,7 +867,7 @@ def main():
867
867
  project_files.extend(load_project_files(additional_path, project_dir))
868
868
 
869
869
  if args.prepend:
870
- prepend = args.prepend
870
+ prepend = args.prepend+"\n"
871
871
  else:
872
872
  prepend = ""
873
873
 
@@ -885,10 +885,10 @@ def main():
885
885
  # If the specified prepend path does not exist, treat the value as literal content.
886
886
  prepend = prepend
887
887
 
888
- if not args.call and not args.apply:
889
- system_prompt = prepend + f"Output a git diff into a ```diff block"
890
- else:
891
- system_prompt = prepend + f"Output a git diff into a <diff> block."
888
+ if prepend != "":
889
+ prepend += "\n"
890
+
891
+ system_prompt = prepend + f"Output a git diff into a ```diff block"
892
892
 
893
893
  files_content = ""
894
894
  for file, content in project_files:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gptdiff
3
- Version: 0.1.16
3
+ Version: 0.1.18
4
4
  Summary: A tool to generate and apply git diffs using LLMs
5
5
  Author: 255labs
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -0,0 +1,9 @@
1
+ gptdiff/__init__.py,sha256=o1hrK4GFvbfKcHPlLVArz4OunE3euIicEBYaLrdDo0k,198
2
+ gptdiff/gptdiff.py,sha256=ZBkgPTcCDumOD7JcWxXDdhh8qykEJb31_AsxRJhRlCE,37876
3
+ gptdiff/gptpatch.py,sha256=Z8CWWIfIL2o7xPLVdhzN5GSyJq0vsK4XQRzu4hMWNQk,2194
4
+ gptdiff-0.1.18.dist-info/LICENSE.txt,sha256=zCJk7yUYpMjFvlipi1dKtaljF8WdZ2NASndBYYbU8BY,1228
5
+ gptdiff-0.1.18.dist-info/METADATA,sha256=vI9eBGXnzwiS67yxnZ6Op6lzm8ssLTq-KSLPWKjxL8w,8785
6
+ gptdiff-0.1.18.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
7
+ gptdiff-0.1.18.dist-info/entry_points.txt,sha256=0VlVNr-gc04a3SZD5_qKIBbtg_L5P2x3xlKE5ftcdkc,82
8
+ gptdiff-0.1.18.dist-info/top_level.txt,sha256=XNkQkQGINaDndEwRxg8qToOrJ9coyfAb-EHrSUXzdCE,8
9
+ gptdiff-0.1.18.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- gptdiff/__init__.py,sha256=o1hrK4GFvbfKcHPlLVArz4OunE3euIicEBYaLrdDo0k,198
2
- gptdiff/gptdiff.py,sha256=wvPbw_M4tXKpg6tTng4EsF4X5lBh1GM5KD6PJyRxoOc,37981
3
- gptdiff/gptpatch.py,sha256=Z8CWWIfIL2o7xPLVdhzN5GSyJq0vsK4XQRzu4hMWNQk,2194
4
- gptdiff-0.1.16.dist-info/LICENSE.txt,sha256=zCJk7yUYpMjFvlipi1dKtaljF8WdZ2NASndBYYbU8BY,1228
5
- gptdiff-0.1.16.dist-info/METADATA,sha256=hhm98oDVM9WIzcNJ9IHcM6auJcGBf46XmLJ9JPLUe_E,8785
6
- gptdiff-0.1.16.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
7
- gptdiff-0.1.16.dist-info/entry_points.txt,sha256=0VlVNr-gc04a3SZD5_qKIBbtg_L5P2x3xlKE5ftcdkc,82
8
- gptdiff-0.1.16.dist-info/top_level.txt,sha256=XNkQkQGINaDndEwRxg8qToOrJ9coyfAb-EHrSUXzdCE,8
9
- gptdiff-0.1.16.dist-info/RECORD,,