xai-review 0.6.0__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xai-review might be problematic. Click here for more details.

@@ -11,34 +11,34 @@ class PromptService:
11
11
  @classmethod
12
12
  def build_inline_request(cls, diff: DiffFileSchema, context: PromptContextSchema) -> str:
13
13
  inline_prompts = "\n\n".join(settings.prompt.load_inline())
14
- prompt = (
14
+ inline_prompts = context.apply_format(inline_prompts)
15
+ return (
15
16
  f"{inline_prompts}\n\n"
16
17
  f"## Diff\n\n"
17
18
  f"{format_file(diff)}"
18
19
  )
19
- return context.apply_format(prompt)
20
20
 
21
21
  @classmethod
22
22
  def build_summary_request(cls, diffs: list[DiffFileSchema], context: PromptContextSchema) -> str:
23
23
  changes = "\n\n".join(map(format_file, diffs))
24
24
  summary_prompts = "\n\n".join(settings.prompt.load_summary())
25
- prompt = (
25
+ summary_prompts = context.apply_format(summary_prompts)
26
+ return (
26
27
  f"{summary_prompts}\n\n"
27
28
  f"## Changes\n\n"
28
29
  f"{changes}\n"
29
30
  )
30
- return context.apply_format(prompt)
31
31
 
32
32
  @classmethod
33
33
  def build_context_request(cls, diffs: list[DiffFileSchema], context: PromptContextSchema) -> str:
34
34
  changes = "\n\n".join(map(format_file, diffs))
35
35
  inline_prompts = "\n\n".join(settings.prompt.load_context())
36
- prompt = (
36
+ inline_prompts = context.apply_format(inline_prompts)
37
+ return (
37
38
  f"{inline_prompts}\n\n"
38
39
  f"## Diff\n\n"
39
40
  f"{changes}\n"
40
41
  )
41
- return context.apply_format(prompt)
42
42
 
43
43
  @classmethod
44
44
  def build_system_inline_request(cls, context: PromptContextSchema) -> str:
@@ -126,3 +126,11 @@ def test_build_system_summary_request_empty(
126
126
  monkeypatch.setattr(PromptConfig, "load_system_summary", lambda self: [])
127
127
  result = PromptService.build_system_summary_request(dummy_context)
128
128
  assert result == ""
129
+
130
+
131
+ def test_diff_placeholders_are_not_replaced(dummy_context: PromptContextSchema) -> None:
132
+ diffs = [DiffFileSchema(file="x.py", diff='print("<<merge_request_title>>")')]
133
+ result = PromptService.build_summary_request(diffs, dummy_context)
134
+
135
+ assert "<<merge_request_title>>" in result
136
+ assert "Fix login bug" not in result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xai-review
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: AI-powered code review tool
5
5
  Author-email: Nikita Filonov <nikita.filonov@example.com>
6
6
  Maintainer-email: Nikita Filonov <nikita.filonov@example.com>
@@ -97,7 +97,7 @@ ai_review/services/llm/openai/client.py,sha256=WhMXNfH_G1NTlFkdRK5sgYvrCIE5ZQNfP
97
97
  ai_review/services/prompt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
98
  ai_review/services/prompt/adapter.py,sha256=xsJwBMmmuD0VIBbA7NCQuE6Zz6WyBoVJE3FuYMLHCxA,1005
99
99
  ai_review/services/prompt/schema.py,sha256=erAecUYzOWyZfixt-pjmPSnvcMDh5DajMd1b7_SPm_o,2052
100
- ai_review/services/prompt/service.py,sha256=AQG0YnlfXYtuADaZDhWD8NkPHx_zH4TCTOFPzMvZaSs,2078
100
+ ai_review/services/prompt/service.py,sha256=VsY8mj6UvY1a4Zsb8JlDJIg_8l7LBW6PXrObiHCwCzo,2128
101
101
  ai_review/services/review/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
102
  ai_review/services/review/service.py,sha256=8YhRFqhZAk2pAnkDaytKSCENlOeOti1brAJq3R9tVMY,8394
103
103
  ai_review/services/review/inline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -145,7 +145,7 @@ ai_review/tests/suites/services/diff/test_service.py,sha256=iFkGX9Vj2X44JU3eFsoH
145
145
  ai_review/tests/suites/services/diff/test_tools.py,sha256=HBQ3eCn-kLeb_k5iTgyr09x0VwLYSegSbxm0Qk9ZrCc,3543
146
146
  ai_review/tests/suites/services/prompt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
147
147
  ai_review/tests/suites/services/prompt/test_schema.py,sha256=XkJk4N9ovgod7G3i6oZwRBjpd71sv0vtVDJhSOfIwGA,2660
148
- ai_review/tests/suites/services/prompt/test_service.py,sha256=XY7FsAhHUjr56AKVMDgCC7OpXOhj2UirB9pARmLjUuc,5236
148
+ ai_review/tests/suites/services/prompt/test_service.py,sha256=M8vvBhEbyHnXCSiIRu7231odn89sPDyCiRMOc2XufC4,5570
149
149
  ai_review/tests/suites/services/review/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
150
150
  ai_review/tests/suites/services/review/inline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
151
151
  ai_review/tests/suites/services/review/inline/test_schema.py,sha256=tIz-1UA_GgwcdsyUqgrodiiVVmd_jhoOVmtEwzRVWiY,2474
@@ -155,9 +155,9 @@ ai_review/tests/suites/services/review/policy/test_service.py,sha256=kRWT550OjWY
155
155
  ai_review/tests/suites/services/review/summary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
156
156
  ai_review/tests/suites/services/review/summary/test_schema.py,sha256=xSoydvABZldHaVDa0OBFvYrj8wMuZqUDN3MO-XdvxOI,819
157
157
  ai_review/tests/suites/services/review/summary/test_service.py,sha256=8UMvi_NL9frm280vD6Q1NCDrdI7K8YbXzoViIus-I2g,541
158
- xai_review-0.6.0.dist-info/licenses/LICENSE,sha256=p-v8m7Kmz4KKc7PcvsGiGEmCw9AiSXY4_ylOPy_u--Y,11343
159
- xai_review-0.6.0.dist-info/METADATA,sha256=OQT-Me4_2Dg1CHGNXQCoZBCE2sl1ceHgroCs0axcb3s,9640
160
- xai_review-0.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
161
- xai_review-0.6.0.dist-info/entry_points.txt,sha256=JyC5URanMi5io5P_PXQf7H_I1OGIpk5cZQhaPQ0g4Zs,53
162
- xai_review-0.6.0.dist-info/top_level.txt,sha256=sTsZbfzLoqvRZKdKa-BcxWvjlHdrpbeJ6DrGY0EuR0E,10
163
- xai_review-0.6.0.dist-info/RECORD,,
158
+ xai_review-0.7.0.dist-info/licenses/LICENSE,sha256=p-v8m7Kmz4KKc7PcvsGiGEmCw9AiSXY4_ylOPy_u--Y,11343
159
+ xai_review-0.7.0.dist-info/METADATA,sha256=gMgMXmkMdDOIFXLGZUt-III2vho6592RWUnuFsb9E94,9640
160
+ xai_review-0.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
161
+ xai_review-0.7.0.dist-info/entry_points.txt,sha256=JyC5URanMi5io5P_PXQf7H_I1OGIpk5cZQhaPQ0g4Zs,53
162
+ xai_review-0.7.0.dist-info/top_level.txt,sha256=sTsZbfzLoqvRZKdKa-BcxWvjlHdrpbeJ6DrGY0EuR0E,10
163
+ xai_review-0.7.0.dist-info/RECORD,,