Skip to content

Commit

Permalink
Fix #58
Browse files Browse the repository at this point in the history
  • Loading branch information
nicovank committed Feb 5, 2024
1 parent 74a5503 commit 2725b05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/cwhy/conversation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ def build_diagnostic_string() -> str:
if count > args.max_error_tokens:
list.pop()
break

if len(front) + len(back) == n:
return diagnostic
return build_diagnostic_string()
1 change: 0 additions & 1 deletion src/cwhy/cwhy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import argparse
import contextlib
import os
import subprocess
import sys
Expand Down
3 changes: 3 additions & 0 deletions src/cwhy/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def build_diagnostic_string() -> str:
if count > self.args.max_error_tokens:
list.pop()
break

if len(front) + len(back) == n:
return "```\n" + "\n".join(self.diagnostic_lines) + "\n```\n"
return build_diagnostic_string()

def get_code(self) -> Optional[str]:
Expand Down

0 comments on commit 2725b05

Please sign in to comment.