codereader 0.7.4__tar.gz → 0.7.6__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codereader
3
- Version: 0.7.4
3
+ Version: 0.7.6
4
4
  Summary: Local code readability grader using LLMs
5
5
  License: GPLv3
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codereader"
3
- version = "0.7.4"
3
+ version = "0.7.6"
4
4
  description = "Local code readability grader using LLMs"
5
5
  authors = [
6
6
  {name = "Jason Liu",email = "Liujason2003@gmail.com"}
@@ -119,7 +119,7 @@ class OllamaRunner:
119
119
 
120
120
  cmd = (
121
121
  [self.ollama_bin, "run"]
122
- + (["--think=false"] if self.no_think else ["--hidethinking"])
122
+ + (["--think=false"] if self.no_think else [])
123
123
  + [self.model]
124
124
  )
125
125
 
@@ -148,7 +148,7 @@ class OllamaRunner:
148
148
  rationale="",
149
149
  )
150
150
 
151
- score = compute_weighted_score(parsed) or clamp_score(parsed.get("score"))
151
+ score = clamp_score(parsed.get("score")) or compute_weighted_score(parsed)
152
152
  rationale = parsed.get("rationale", "")
153
153
  if score is None:
154
154
  return GradeResult(
@@ -233,6 +233,14 @@ def extract_json_object(text: str) -> Optional[Dict[str, Any]]:
233
233
  if any(k in parsed for k in ("score", "subscores", "scores", "rationale")):
234
234
  return parsed
235
235
 
236
+ score_match = re.search(r'"score"\s*:\s*(\d+)', text)
237
+ if score_match:
238
+ try:
239
+ score = int(score_match.group(1))
240
+ return {"score": score}
241
+ except Exception:
242
+ pass
243
+
236
244
  return None
237
245
 
238
246
 
File without changes
File without changes