coderabbitai / ai-pr-reviewer

AI-based Pull Request Summarizer and Reviewer with Chat Capabilities.
https://coderabbit.ai
MIT License
1.41k stars 256 forks source link

Prompt limit issue fixed #501

Open Infracloud-harsh opened 7 months ago

Infracloud-harsh commented 7 months ago

Summary by CodeRabbit

github-actions[bot] commented 7 months ago

Image description CodeRabbit

Walkthrough

This update enhances the GitHub Actions workflow and README file, introduces a new function splitPrompt with its test suite for handling large prompts, and improves the handling of large files in the codeReview and doSummary functions. The changes aim to optimize performance and maintainability.

Changes

Files Summary
.github/workflows/openai-review.yml, README.md Updated the concurrency group configuration in the GitHub Actions workflow and restructured the README file for better organization.
__tests__/tokenizer.test.ts, src/tokenizer.ts Introduced a new function splitPrompt that splits a prompt into multiple pieces based on a maximum token count, along with a comprehensive test suite.
src/inputs.ts, src/prompts.ts, src/review.ts Added a new property fileIndex to the Inputs class and improved the handling of large files and prompts in the codeReview and doSummary functions.

🐰 "In the land of code, where logic is king,

We dance with tokens, in a ring.

Large files we split, with a swift rabbit's hop,

Making our codebase, rise to the top! 🎉"


Uplevel your code reviews with CodeRabbit Pro ### CodeRabbit Pro If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.
Infracloud-harsh commented 6 months ago

Hello @harjotgill, I have worked on the issue of prompt limit for long PRs. It works properly for us. Can we please have a look on this PR.