Commit Graph

25 Commits

Author SHA1 Message Date
cc686ef26d Reorder model check: OpenAI before Anthropic
OpenAI is the default in most cases, so checking it first skips unnecessary Anthropic logic.
2025-05-22 13:12:04 +09:00
ead7491ca9 Apply convention for marking private 2025-05-21 18:08:48 +09:00
df0355d827 Remove member variable for restroring get_settings() 2025-05-21 18:07:47 +09:00
c3ea048b71 Restore original return logic for force_accurate condition 2025-05-21 17:52:51 +09:00
648829b770 Rename method 2025-05-21 17:51:03 +09:00
97f2b6f736 Fix TypeError 2025-05-20 15:29:27 +09:00
f198e6fa09 Add constants and improve token calculation logic 2025-05-20 14:12:24 +09:00
e72bb28c4e Replace get_settings() with self.settings 2025-05-20 13:50:30 +09:00
81fa22e4df Add model name validation 2025-05-20 13:47:15 +09:00
05ab5f699f Improve token calculation logic based on model type
- Rename calc_tokens to get_token_count_by_model_type for clearer intent
- Separate model type detection logic to improve maintainability
2025-05-16 17:51:22 +09:00
08bf9593b2 Fix tokenizer fallback to use o200k_base instead of cl100k_base 2025-04-14 21:15:19 +03:00
14971c4f5f Add support for documentation content exceeding token limits (#1670)
* - Add support for documentation content exceeding token limits via two phase operation:
1. Ask LLM to rank headings which are most likely to contain an answer to a user question
2. Provide the corresponding files for the LLM to search for an answer.

- Refactor of help_docs to make the code more readable
- For the purpose of getting canonical path: git providers to use default branch and not the PR's source branch.
- Refactor of token counting and making it clear on when an estimate factor will be used.

* Code review changes:
1. Correctly handle exception during retry_with_fallback_models (to allow fallback model to run in case of failure)
2. Better naming for default_branch in bitbucket cloud provider
2025-04-03 11:51:26 +03:00
8495e4d549 More comprehensive handling in count_tokens(force_accurate==True): In case model is neither OpenAI nor Anthropic Claude, simply use an elbow room factor in order to force a more conservative estimate. 2025-03-24 15:47:35 +02:00
dd80276f3f Support cloning repo
Support forcing accurate token calculation (claude)
Help docs: Add desired branch in case of user supplied git repo, with default set to "main"
Better documentation for getting canonical url parts
2025-03-23 09:55:58 +02:00
81dea65856 Format files by pre-commit run -a
Signed-off-by: Yu Ishikawa <yu-iskw@users.noreply.github.com>
2024-10-30 10:00:36 +09:00
84b80f792d protections 2024-08-09 21:44:00 +03:00
9c3673209d TokenEncoder 2024-04-03 08:42:50 +03:00
901c1dc3f0 issue tool 2023-09-06 08:43:01 +03:00
e0f295659d A less hacky way 2023-08-09 12:17:54 +03:00
ed8554699b bug fixes and updates 2023-08-03 16:05:46 -07:00
d7b77764c3 Support context aware settings (for each incoming request), support override of settings, refactor CLI to use pr_agent.py 2023-08-01 14:43:26 +03:00
02a1d8dbfc Add support for fallback models 2023-07-23 16:16:36 +03:00
e2a4cd6b03 docstring 2023-07-20 10:51:21 +03:00
259fa84eeb disabling encoding error on special_tokens 2023-07-06 13:22:12 +03:00
4b4d91dfe9 Initial commit - PR-Agent OSS release 2023-07-06 00:21:08 +03:00