Add dynamic context handling in git patch processing

- Introduce `allow_dynamic_context` and `max_extra_lines_before_dynamic_context` settings.
- Adjust context limits dynamically based on section headers.
- Add logging for dynamic context adjustments and section header findings.
This commit is contained in:
mrT23
2024-08-18 17:45:18 +03:00
parent 7cbe797108
commit e9535ea164
2 changed files with 44 additions and 10 deletions

View File

@ -20,6 +20,8 @@ max_commits_tokens = 500
max_model_tokens = 32000 # Limits the maximum number of tokens that can be used by any model, regardless of the model's default capabilities.
custom_model_max_tokens=-1 # for models not in the default list
#
allow_dynamic_context=true
max_extra_lines_before_dynamic_context = 10 # will try to include up to 10 extra lines before the hunk in the patch, until we reach an enclosing function or class
patch_extra_lines_before = 3 # Number of extra lines (+3 default ones) to include before each hunk in the patch
patch_extra_lines_after = 1 # Number of extra lines (+3 default ones) to include after each hunk in the patch
secret_provider=""