Skip to content

Commit

Permalink
Fix bug from argument removal
Browse files Browse the repository at this point in the history
  • Loading branch information
nicovank committed Feb 6, 2024
1 parent e1b6e76 commit 7c9c294
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/chatdbg/chatdbg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ def use_argparse(full_command):
default=60,
help="the timeout for API calls in seconds",
)
# This is only used in the conversation mode.
parser.add_argument(
"--max-error-tokens",
type=int,
default=1920,
help="the maximum number of tokens from the error message to send in the prompt",
)

args = parser.parse_args(full_command)
return args
Expand Down
3 changes: 3 additions & 0 deletions src/chatdbg/conversation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def build_diagnostic_string():
if count > args.max_error_tokens:
list.pop()
break

if len(front) + len(back) == n:
return diagnostic
return build_diagnostic_string()


Expand Down

0 comments on commit 7c9c294

Please sign in to comment.